Setting and using data in Switch for email address

Post Reply
SkiDunn
Newbie
Posts: 1
Joined: Fri Jun 11, 2021 1:01 am

Setting and using data in Switch for email address

Post 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.
User avatar
magnussandstrom
Advanced member
Posts: 365
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: Setting and using data in Switch for email address

Post 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.
Last edited by magnussandstrom on Mon Aug 14, 2023 9:11 am, edited 3 times in total.
User avatar
JimmyHartington
Advanced member
Posts: 310
Joined: Tue Mar 22, 2011 7:38 am

Re: Setting and using data in Switch for email address

Post 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
Post Reply