Newbie needs some assistance, please
I am in need of creating a variable subject line for an email based on the file extension, [Job.Extension].
There are 2 types of files, text (.txt) and pdf (.pdf). It would be a basic subject line would be, "A new text file is available" or "A new pdf file is available" based on that extension type.
Thanks for any help or direction you can provide.
Variable Subject Line
-
- Newbie
- Posts: 4
- Joined: Thu May 19, 2022 10:08 am
- Location: Germany
- Contact:
Re: Variable Subject Line
I don't know precisely how you gonna use it but it seems that you can fix or build a solution without coding.
- billy.olvestad
- Member
- Posts: 54
- Joined: Mon Nov 19, 2018 10:08 pm
- Location: Sweden
- Contact:
Re: Variable Subject Line
You can do that without scripting.
I have attached a sample flow that does this.
First it separates the files on three branches. One for PDF-files, one for text files and one for all other types of files.
Click the individual arrows and look at the property window. Under "include these jobs" it has "file types defined" and each file type chosen, and for the middle one "all other jobs".
It then sets a private data variable named "subject" for each type, with the corresponding subject text line (coloured the folders blue to illustrate which ones I am talking about). Click the folders and look at the property window, and you will see that under "set job private data" it has "multi-line text with variables" chosen, and if you hover over that for a while you will see the variable written. You can of course change that text.
In the last step I just inserted a dummy "mail send" configurator to show the private data variable chosen in the properties. Under "subject" it has "single-line text with variables defined". The code there is [Job.PrivateData:Key="subject"] to make Switch insert the private data variable into the subject.
I have attached a sample flow that does this.
First it separates the files on three branches. One for PDF-files, one for text files and one for all other types of files.
Click the individual arrows and look at the property window. Under "include these jobs" it has "file types defined" and each file type chosen, and for the middle one "all other jobs".
It then sets a private data variable named "subject" for each type, with the corresponding subject text line (coloured the folders blue to illustrate which ones I am talking about). Click the folders and look at the property window, and you will see that under "set job private data" it has "multi-line text with variables" chosen, and if you hover over that for a while you will see the variable written. You can of course change that text.
In the last step I just inserted a dummy "mail send" configurator to show the private data variable chosen in the properties. Under "subject" it has "single-line text with variables defined". The code there is [Job.PrivateData:Key="subject"] to make Switch insert the private data variable into the subject.
- Attachments
-
- subject_line.png (30.65 KiB) Viewed 2017 times
-
- subject_line.zip
- (8.52 KiB) Downloaded 156 times
Re: Variable Subject Line
Thank you. I was able to create a variable subject line based on the extension. No scripting needed!