Adding attachments to an non-default email template

4 posts by 2 authors in: Forums > CMS Builder
Last Post: October 11, 2023   (RSS)

By JeffC - October 7, 2023

I would like to be able to add attachments to one of my email templates.

I've found these instructions in /lib/mail_functions.php. But this file only contains the code for the default email templates. I would like to add attachments to a template that I have added. Where can I find these?

Thanks

  // Full Featured Example:

  $errors = sendMessage(array(
    'from'    => "from@example.com",
    'to'      => "to@example.com",
    'subject' => "Enter subject here, supports utf-8 content",
    'text'    => "Text message content",
    'html'    => "<b>HTML</b> message content",

   'headers' => array(
      "CC"              => "cc@example.com",
      "BCC"             => "bcc@example.com",
      "Reply-To"        => "rt@example.com",
      "Return-Path"     => "rp@example.com",
      "x-custom-header" => "12345",
    ),

    'attachments' => array(
      'simple.txt'  => 'A simple text file',
      'dynamic.csv' => $csvData,
      'archive.zip' => $binaryData,
      'image.jpg'   => file_get_contents($imagePath),
    ),
Jeff

By Dave - October 7, 2023

Hi Jeff, 

What code is sending the message?  Is it custom or Newsletter Builder or something else?  

What we'd need to do is all the attachment options to the sending code.

Let me know some details and we'll see what's possible.

Dave Edis - Senior Developer
interactivetools.com

By Dave - October 11, 2023

Hi Jeff, 

Yea, that's interesting.  I think we can set that up.  Can you email me directly with details?  We implement it for you and cover the cost, using your site as a test case and adding it to the CMS.

Thanks

Dave Edis - Senior Developer
interactivetools.com