You are viewing limited content. For full access, please sign in.

Question

Question

How handle attachments in custom activity

asked on February 13, 2021

Hello everyone,

 

I have been working on a task lately to create a workflow custom activity

send emails through API services like Mailgun, the first thing came to my mind

was how to send attachments through this activity, in my little research

i was able to find the AttachmentsControl, thus i have created a custom class

for the mail object, and i have created a custom control to add the attachment

control to it and use it to pass the values to the activity.

I have tried multiple types of objects too but have struggled with it in many

areas:

1) On the workflow designer whenever i try to add two instances of the activity

i can see the same attachments already available.

2) The attachments does not load full information of Exported Entries when i close

and reopen the workflow designer. (I have created a button to show me the objects values in messagebox).

3) According to point number 2 the same happens in the activity where it receives

null objects.

4) How to get the EntryInformation82 object from ActivityBindingProxy in order to be able to export it with the options user has setup(Password encrypted PDF, Export Elec Document, etc...).

5) The DownloadEntryExporter class does not create the file with its original name,

and also it creates it in paths inside the path you specify for exporting with a .wfv file which is an XML.

 

Attached is the solution i have been working on for the reference.

 

Appreciate any help or guidance in completing this task, thanks in advance.

 

https://drive.google.com/file/d/1vS_z3kspCHj1MvdEei_ZveDxSwcsA_gk/view?usp=sharing

 

0 0

Replies

replied on February 15, 2021

Hello,

If that helps you, you will find attached a workflow template that explains how to retrieve multi-valued tokens (IDs) and how to detach your files (protected or not) for sending mail.
Hope to have helped you.

Rename pdf.file to --> Test_Multi_Id_For_SendMail.wfi and import it in Workflow Designer.

1 0
replied on February 22, 2021

Dear Mr. Zarrouk,

 

Appreciate your help, i managed to build it with the basic text controls,

attachments is to yet to be encrypted as this is still a work in progress.

I was wishing to be able to have the built-in E-mail control implemented

in a new custom activity and be able to rebuild a new control for specifying

the API connection settings instead of the SMTP.

I will be looking in depth into thus further and see if i can achieve it.

For now, i really thank your help but if there is a way to make it even better 

please do not hesitate to share your ideas with me.

 

Many thanks again.

0 0
replied on February 14, 2021

Hello,

Why don't you create in the workflow an SDK Script activity in which you detach your attachments and you call your API (dll) or by a REST API call?
You can do the same thing with a custom activity by passing as parameters the Id (s) of the attachments to send.
Personally, I would rather use the first solution, which is easier to maintain and deploy.

0 0
replied on February 15, 2021

Dear Mr. Zarrouk,

 

Appreciate your help and suggestion,

In your suggestion, can i keep the Entries Ids as a token? (To keep the workflow

as dynamics as possible).

Also, can i keep the options of having password protected extraction option and

other attachment options available?

These two points are very important for my task to be completed successfully.

 

Thanks you again, have a nice day.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.