Adding attachments to an non-default email template

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

By JeffC - October 7

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?


  // Full Featured Example:

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

   'headers' => array(
      "CC"              => "",
      "BCC"             => "",
      "Reply-To"        => "",
      "Return-Path"     => "",
      "x-custom-header" => "12345",

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

By JeffC - October 8

Thanks Dave

It's a email set up in the Email Templates section editor (

The site uses the Membership Plugin to send an email to a new user when signing up. The template ID is the default one (USER-SIGNUP) that the plugin creates.

We'd like to add a 'Welcome Pack' as an email attachment (which consists of 2 Word .docs.



By Dave - October 11

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.


Dave Edis - Senior Developer