Page 1 of 1

Setting and using data in Switch for email address

Posted: Fri Aug 11, 2023 8:54 pm
by SkiDunn
I have a job coming into Switch. In the job folder is a PDF with the name of a person I need to email for approval. I am trying to grab that name then strip it out of the name yet use it later to send the email to for approval. Sample PDF is named 123456L Compnay JohnDoe.pdf I want to store JohnDoe in side of the metadata then rename the file to 123456L Company.pdf and send JohnDoe@ourcompany.com an approval email with a link to where we are hosting the pdf.

I can do everything but get JohnDoe email working.

Re: Setting and using data in Switch for email address

Posted: Mon Aug 14, 2023 8:20 am
by magnussandstrom
You can set ’name’ to a PrivateData tag and use it later in the flow.

In Folder properties > Set job private data:
name= [Job.Name:After=" ",Before="."]

Later in the flow you can use the variable:
[Job.PrivateData:Key="name"]@company.com

This way you can use the name in an email adress even after you have removed it from the file name.

Re: Setting and using data in Switch for email address

Posted: Mon Aug 14, 2023 8:24 am
by JimmyHartington
In the mail send you could set the to address to the variable below:
[Job.NameProper:After=" "]@company.com

In my test with a sample file named "123456L Compnay JohnDoe.pdf" it gives me "JohnDoe".
Image