Page 1 of 1

How to set text file contents as email body

Posted: Sat Jan 16, 2021 9:33 am
by mrkkrai
Hi:

Please help me to set text file contents as email body of Mail send configurator.

Thanks

Re: How to set text file contents as email body

Posted: Sat Jan 16, 2021 9:42 am
by jan_suhr
You can add the text file as an Opaque dataset to the job in the flow.

Then in the Email configurator you pick up that Dataset as a Template dataset with the Body template as Associated with job

Re: How to set text file contents as email body

Posted: Sat Jan 16, 2021 12:37 pm
by mrkkrai
Thanks a ton sir...

I tried and succeeded.

Is there any possibility to email some particular text from that text file?

Re: How to set text file contents as email body

Posted: Sat Jan 16, 2021 12:57 pm
by jan_suhr
You can have Switch variables as markers in the text file and from that add text to the mail.

But if you need to edit the text it has to be done before it becomes a dataset.

Re: How to set text file contents as email body

Posted: Mon Jan 18, 2021 11:00 am
by mrkkrai
Is there any way to convert text file to xml so that I can use XML Pickup?

Re: How to set text file contents as email body

Posted: Thu Mar 11, 2021 5:44 pm
by Pantone485
Hey!

I am new on Switch but think it is extremely fun and powerful tool.

I have set up a flow that sorts pdf files according to number of pages. There are 5 different variants, 2, 4, 6, 8 and everything over 8 pages.
Then the files are collected so that all 2-pages, 4-pages, etc. end up in the same file. Then an email is sent with a summary of how many of each variant. Everything works well so far. The problem is when I want to use my own "HTML Template" for mail send
If I send the email as plain text, it goes well. If I send as HTML and use a "Built-in" template, it works fine, but if I use my own template, I do not get the text. Which variable should I use to trigger my info? Or where can I find the "Built-in" template and can edit it? Please see attached photos. Thanks in advance!
The attachment Plain text.png is no longer available
The attachment Enfocus_HTML.png is no longer available
Plain text.png
Plain text.png (27.37 KiB) Viewed 10850 times

Re: How to set text file contents as email body

Posted: Thu Mar 11, 2021 5:48 pm
by Pantone485
Enfocus_HTML.png
Enfocus_HTML.png (97.33 KiB) Viewed 10849 times
Own_HTML.png
Own_HTML.png (21.05 KiB) Viewed 10849 times

Re: How to set text file contents as email body

Posted: Thu Mar 11, 2021 6:00 pm
by jan_suhr
In your own HTML-template you insert Switch variables with the information you want to display in the email.

Re: How to set text file contents as email body

Posted: Fri Mar 12, 2021 3:28 pm
by Pantone485
jan_suhr wrote: Thu Mar 11, 2021 6:00 pm In your own HTML-template you insert Switch variables with the information you want to display in the email.
Yes, I agree. The problem is that I do not know what "Switch variable" I should use. I have tried several different but without success. (see attached file) If I were to access the "built.-in" template, can I see what it looks like or do you know which variable (s) I should choose? Thanks in advance!

Re: How to set text file contents as email body

Posted: Fri Mar 12, 2021 3:34 pm
by jan_suhr
I see that you are from Sweden, call me at 0707490774 and I can take a look at it.

Re: How to set text file contents as email body

Posted: Mon Mar 15, 2021 5:35 pm
by essexmate
Pantone485 wrote: Fri Mar 12, 2021 3:28 pm
jan_suhr wrote: Thu Mar 11, 2021 6:00 pm In your own HTML-template you insert Switch variables with the information you want to display in the email.
Yes, I agree. The problem is that I do not know what "Switch variable" I should use. I have tried several different but without success. (see attached file) If I were to access the "built.-in" template, can I see what it looks like or do you know which variable (s) I should choose? Thanks in advance!
In your html you need to insert your switch variable inbetween <span> </span>

example:

Code: Select all

<p>Hello <span>[Job.UserFullName]</span></p>

Re: How to set text file contents as email body

Posted: Tue Mar 16, 2021 8:18 am
by freddyp
Putting the Switch variable in between a <span> construction is not necessary. It can be anywhere in the HTML as long as you take care to keep the HTML structure valid after the value of the variable is inserted. Here is an example that uses two Switch variables:
  • the name of the job: [Job.Name]
  • the link to the document on the PDF Review Server:[ Job.PrivateData:Key="com.enfocus.PDFReviewModule.URL"]
The example displays only the name of the job in some kind of blue to indicate that it is a link. The link itself is not displayed but clicking on the name of the job will jump to it:

Code: Select all

<a href="[Job.PrivateData:Key="com.enfocus.PDFReviewModule.URL"]" style="color:#337ab7; text-decoration: none;"><font face="Arial, Helvetica, sans-serif" color="#337ab7" size="2" style="font-size:16px;">[Job.Name]</font></a>