Apologies if this is a basic request, but I’m under time pressure to complete.
Have a mail merged letter with different names/addresses that are required to be sent as a single attached PDF to each different email addresses.
I’ve set up a Print template and data mapper with that merges the data. I see there are different methods to process emails, either in Designer or Workflow. Tried a number of different approaches using Dynamic Attachment Script Wizard, but I’m not familiar with scripting. Also created an Email template. I can set this up in PP7 fine, but would like instruction on the simplest way to set up with Connect please? Thank you.
A possible solution is to generate the PDF file by OL Connect first, to store this PDF file in a specific directory and write the directory path to a Job Info- or Local variable. You can then use a Standard script like the below one to use the directory path written to the Job Info- or Local variable and attach the same PDF file to each individual email.
Standard script
Name: PDF attachment Selector: html.HTML_EMAIL[section="Content"] head
var pdfFile = "";
//pdfFile = "file:///C:/OLCW/PDF-attachments/example-20251111153130.pdf";
pdfFile = automation.jobInfos.JobInfo9;
/**
* Check if the variable `pdfFile` is not an empty string and if the file
* exists before adding the `<link>`-element to the `<head>`-element.
*/
if (pdfFile !== "" && resource(pdfFile)) {
var elem = query("<link rel=related>");
elem.attr("title", pdfFile.split("/").pop().split("\\").pop());
elem.attr("href", pdfFile);
results.append(elem);
}
Can I please confirm this format doesnt work anymore?
We recently upgraded to the latest version 2025.2.1. Our pdf files are stored in a network drive (UNC path)
"file:///\\server01\path\to\pdf\name.pdf" this used to work before. Now I had to remove the "file:///" for it work when sending emails with attachment using external file.
Did you upgrade OL Connect from an older version than version 2025.1.n to version 2025.2.1? And does the path contain any spaces? Because it looks like that the following is the case:
As of OL Connect 2025.1 we no longer accepted URLs with spaces due to a change in the underlying framework. We now work around potential regression issues by automatically encoding spaces where possible. (96144)
We upgraded from 2024.2.3 (the latest of 2024) to 2025.2.1.
The path do not contain any spaces. It seems that "\\server\path\to\attachments\1.pdf" as is now work without the "file:///". Take note ^ the above is escaped.
So a path like file://///server/path/to/attachments/1.pdf did work in version 2024.2.3 but needed to be changed to //server/path/to/attachments/1.pdf to get it working in version 2025.2.1. Is that correct? If this is correct; can you submit a ticket via the support portal for this issue please?