• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Directory Emails - Attaching PDF

Directory Emails - Attaching PDF 2 years 5 months ago #42334

Hello,

Is it possible to attach the user.pdf to a directory email? Essentially what I'm trying to accomplish is to provide a user with an updated PDF after they modify a submission on the directory page.

Thank you!
The administrator has disabled public write access.

Directory Emails - Attaching PDF 2 years 5 months ago #42340

There may be a better way of doing this, but I was able to use the save PDF to folder directions on the "Script called before the Directory Emails are sent" section to save the modified PDF locally and then using $directoryEmail[] = $pdfUserfile; to send out an updated user_pdf.

list($replace, $with) = RSFormProHelper::getReplacements($SubmissionId);
$pdfUser = str_replace($replace, $with, '{user_pdf}');
 
//destination path for the User PDF file:
$pdfUserfile = JPATH_SITE.'/tmp/pdf-user-'.$SubmissionId.'.pdf';
 
$http = JHttpFactory::getHttp();
 
if ($response = $http->get($pdfUser))
{
   file_put_contents($pdfUserfile, $response->body);
}
 
$directoryEmail['files'][] = $pdfUserfile;
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!