Retrieving Email Addresses for Use in Mail Task
My organization’s instance of the DGC does not use email addresses as usernames, as is the presumption in how I have learned to develop mail tasks. At user profiles, Contact information does still list an email address for each DGC user.
Page 199 of the DGC manual) discusses how to use the “getEmailAddresses()” expression apparently to access any such addresses.
Where and how could I insert this expression into the serviceTask below in order to call on the startUser’s email address? Thanks.
<serviceTask id="mailtask2" name="Approved-Term Mail Task" activiti:type="mail">
<extensionElements>
<activiti:field name="to">
<activiti:expression><![CDATA[${startUser}]]></activiti:expression>
</activiti:field>
<activiti:field name="from">
<activiti:string><![CDATA[[email protected]]]></activiti:string>
</activiti:field>
<activiti:field name="subject">
<activiti:expression><![CDATA[Your Term '${assetName}' Approved in Dictionary]]></activiti:expression>
</activiti:field>
<activiti:field name="html">
<activiti:expression><![CDATA[Your requested term <b>"${assetName}"</b> has been approved for the Dictionary. Thank you.]]></activiti:expression>
</activiti:field>
</extensionElements>
</serviceTask>tylerbass
Posted 4 years ago · Edited 1 year ago·Last reply 4 years ago
2 comments
tylerbass
OP4 years ago · EditedHi, Alvin,
That user-expression suggestion was the cat’s pajamas and proved effective. Thank you so much.
Best,
Tyler
alvinuseree
·4 years ago · EditedThat shouldn’t matter! So you just have to pass the relevant user expression.
There are plenty of good examples on this forum but here’s one I posted a while back. Scroll down to the picture.
https://datacitizens.collibra.com/forum/t/change-subject-and-adding-logo-in-email-template/605/7
For the startUser the user expression is user(${startUser})
I’ve never been able to get the from property working but by default the mail is sent from [email protected]