Leave feedback
  • Static Email attachments with dynamic paths and condition

Write an Article
Thursday 17 October, 2013
Rahul S Rahul S
1 likes 9779 views

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[1] = "SMTP Email";

StaticAttachment();

Hope you will find this solution quite useful .

Your suggestions and feedback are welcome.

Best Wishes,

Rahul Sinha

 

Attached files

Comments (9)

  • Hi Rahul,

    what connector you have used SMTP (MIME) or SMTP (MIME) Mail out or SMTP(MIME) Legecy? did you use mailout process also?

    where you gave variables for name of the attachment pdf and path of the attachment and where exactly you are saying to call a function that you have created.

    Regards

    Vikas

    Wednesday 04 December, 2013 by Vikas Rathaur
  • Hi Rahul,

    could you please respond to my comment.

    Thanks & Regards

    Vikas

    Thursday 05 December, 2013 by Vikas Rathaur
  • Hi,

    I have used SMTP (MIME), mailout process is not used

    variables name comes from your event StreamIN and just call this function in your process script at Before Trigger.

    Thanks,

    Thursday 05 December, 2013 by Rahul S
  • Hi Rahul,

    I want to know have u given your variables in the runtime settings of the connector? because i have tried to give but it was not working there.

    Regards can you attach screenshot or can you provide test dc package?

    Vikas Rathaur

    Thursday 05 December, 2013 by Vikas Rathaur
  • Hi,

    use $channel[1] = "SMTP Email"; in before trigger of your process script and $channel[*] in your channel selcetion method at runtime level.

    This is the settings I have used and it works fine.

    Thursday 05 December, 2013 by Rahul S
  • Hi Rahul,

    This is ok this is for choosing connector dyanamically. but my requirement is to use dyanamic path of email attachment "Static Email attachments with dynamic paths". how you have achived this? what configuration you did in your runtime setting for email body and email attachment?

    Regards

    Vikas

    Thursday 05 December, 2013 by Vikas Rathaur
  • Hi Rahul,

    I have a requirement that i have 5 to 6 different application which will generate pdf and output will be at different folders in local machine and after that my email service application will run which will send email to all the customers whose pdf's are genrated and attach generated pdf in the mail.

    Regards

    Vikas

    Thursday 05 December, 2013 by Vikas Rathaur
  • HI,

    For this you need to give pdf paths in function and put below in youe process script

    $channel[1] = "SMTP Email";

     StaticAttachment();

    StaticAttachment() function will attach your multiple pdf files at runtime .

     

    Thursday 05 December, 2013 by Rahul S
  • Hi,

    In you function you have called some other functions also. what they will do?

    Regards

    vikas

    Thursday 05 December, 2013 by Vikas Rathaur

   


Post comment