Question
Evoke Technologies
IN
Last activity: 3 Apr 2024 5:52 EDT
Send Email Smart Shape: Input when Field Is selected for Choose attachments option
Hi Everyone,
In our application we are using a Send Email smart shape to send email to users with attachments. We want to send attachments of different categories based on conditions. We see that there is an option to select field. What exactly is this option and what are the inputs it is expecting? When we set the file category in a property and refer the same on the Smart shape, on the trace we could see that instead of passing it as value, the property itself is being passed. Even with the sendsimpleemail utility, if we give the file category, it is not sending any attachment. On the doccumentation there isn't any mention of what kind of input we need to give for that field.
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 3 Apr 2024 5:52 EDT
Maantic Technologies Pvt Ltd.
IN
I did some research on this and found out that the "field" option is for "Attachment" type of field created form app studio.
If you navigate to Data Model tab in case type and add a new field from app studio you will also find a option of type "Attachment"
You will notice that if you create a field (property in the background) that way the actual property which gets created in the background is of type page and refers a data page called D_AttachmentFieldInfo. You can refer to property Evidence in class PegaSample-Work-ServiceRequest to get an idea how these fields are created in the background.
Now coming back to the Send Email shape, when you try to use the Field option under Choose attachments, you will be presented with these fields that you would have created using app studio. Alternatively you can also create a property with similar configuration from dev studio manually. You should still get the same in the Field drop down. Now using these fields you can send emails as each of these fields are associated with one attachment category as well.
However, since your requirement is that you are unaware of how many and which attachment categories to send at compile time it is not possible to use this option. Since there is basically no difference between the options Category and Field, both are same, 1:1 mapping and you need to know before hand how many and which attachments to send.
Hope this helps
Maantic Technologies Pvt Ltd.
IN
Hi @Abhiveer Jatla,
Instead of using the send email smart shape you can use the activity pzSendEmail, which has a parameter AttachmentCategoriesToSend. You can consider setting this value dynamically prior to calling the activity such that it stores all the attachment categories that needs to be sent.
Evoke Technologies
IN
Hi @SrijitaB,
Even we can use SendSimpleEmail to achieve this by passing the dynamic property to the parameter AttachmentCategoriesToSend. This is also working for us. We just wanted to know what exactly should we feed when we select the field option from the dropdown for the choose attachments option.
Maantic Technologies Pvt Ltd.
IN
Ideally, you should be able to see all the attachment categories that you have defined in your work class to select as soon as you select the option "Choose attachments". You can now select the attachment categories which you want to send as attachments.
Evoke Technologies
IN
Up until now we are using Category option to send the attachment to the email. When you click on the dropdown, we will have one option called field, we are exploring this option. So, we are looking for what exactly do we need to provide as input when we select option as Field in the dropdown. Is it a file category value? Or pzInsKey of the link-attachment instance or the Data-WorkAttach-File instance, we are not sure and I don't see any relevant docx on pdn stating the expected input for this option.
Updated: 30 Mar 2024 12:53 EDT
Maantic Technologies Pvt Ltd.
IN
You can set a property before the send email shape in the flow, make sure the property contains comma seperated category values. Based on the values provided the system will ensure the attachments of those categories to be included as part of the email. Once you set the property pass the same property in the send email shape.
This approach can be also be used for implementing decision based email attachment category requirement.
You can also have a look in a similar post below.
Evoke Technologies
IN
@SrijitaB We tried by passing file category in csv format but no luck. We tried using with Send Email smart shape and also by invoking SendSimpleEmail activity. In both the scenarios, we were not able to achieve the attachment on the email.
Accepted Solution
Updated: 3 Apr 2024 5:52 EDT
Maantic Technologies Pvt Ltd.
IN
I did some research on this and found out that the "field" option is for "Attachment" type of field created form app studio.
If you navigate to Data Model tab in case type and add a new field from app studio you will also find a option of type "Attachment"
You will notice that if you create a field (property in the background) that way the actual property which gets created in the background is of type page and refers a data page called D_AttachmentFieldInfo. You can refer to property Evidence in class PegaSample-Work-ServiceRequest to get an idea how these fields are created in the background.
Now coming back to the Send Email shape, when you try to use the Field option under Choose attachments, you will be presented with these fields that you would have created using app studio. Alternatively you can also create a property with similar configuration from dev studio manually. You should still get the same in the Field drop down. Now using these fields you can send emails as each of these fields are associated with one attachment category as well.
However, since your requirement is that you are unaware of how many and which attachment categories to send at compile time it is not possible to use this option. Since there is basically no difference between the options Category and Field, both are same, 1:1 mapping and you need to know before hand how many and which attachments to send.
Hope this helps