how to add a static attachment to an email where static file path is based upon condition.
Static Email attachments with dynamic paths and condition-
Hi There, attaching static files with email on the fly looks simple but what happen when the file paths are dynamic or conditional.
For this scenario I I have got a solution which handles this complexity efficiently and I thought it’s a good idea to share here with you guys.
I have created a function and attached a script for this, in the function you can define dynamic file paths or conditional file paths and attach the files . If file path or name is not proper script execution continues with no fatal error, email gets generated without attaching the incorrect file.
You need to call the function in before trigger where you have SMTP MIME as output connector
$channel = "SMTP Email";
Hope you will find this solution quite useful .
Your suggestions and feedback are welcome.