CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Adding an attachment to a message template
Pages: [1]

Author Topic: Adding an attachment to a message template  (Read 1063 times)

malks

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 7
  • CiviCRM version: 3.4.x 4.x
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.x
  • PHP version: 5.3.x
Adding an attachment to a message template
April 04, 2011, 09:27:31 pm
Hi,

Not sure if this is the right place to ask this, but is there any possibility of adding an attachment to a message template, namely the membership confirmation as the client would like to send a pdf handbook along with the email.

If this is not standard, how do I go about building this?  I could probably use custom data to get the attachment on to the membership but not sure what hook to use to get the attachment on to the email.

Thanks.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Adding an attachment to a message template
April 05, 2011, 10:07:43 am

Currently u cant add attachments to message templates. No plans for this in the short term either

This hook might allow u to do so:

http://wiki.civicrm.org/confluence/display/CRMDOC32/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmalterMailParams

would be great if you can report back on if it worked and the needed code

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Adding an attachment to a message template
April 05, 2011, 10:16:04 am
If Lobo's suggestion doesn't work for you - another approach would be to just put the PDF handbook up on their server somewhere and add a URL to it in the message template (KISS principle) :-)

Protect your investment in CiviCRM by  becoming a Member!

malks

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 7
  • CiviCRM version: 3.4.x 4.x
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.x
  • PHP version: 5.3.x
Re: Adding an attachment to a message template
April 05, 2011, 05:15:52 pm
Thanks guys.  I had mentioned a link to them and that is our fallback, but I didn't know about that hook, so will investigate and get back to you :)

malks

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 7
  • CiviCRM version: 3.4.x 4.x
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.x
  • PHP version: 5.3.x
Re: Adding an attachment to a message template
April 06, 2011, 06:18:23 pm
Lobo, a question for you...  The attachment will be based on the event that the contact is participating in, and you can do a custom data for the event which covers this.  I can get the contact in the hook_civicrm_alterMailParams and you can tell it's a workflow message and which template it is using from the params.  I can get the most recent record from the civicrm_participant table and the event from that, but I was wondering if there was a more robust way of making sure that I have the right event and therefore the right attachment.  The only problem with that is the most "recent" isn't a timestamp but an entered field (Registration Date, which can be changed).  I tried looking into hook_civicrm_postProcess to maybe add something to the mail parameters, but this is getting called after hook_civicrm_alterMailParams so doesn't do me any good.

I suspect the answer is no, without changing core, but just thought I'd check before assuming.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Adding an attachment to a message template

This forum was archived on 2017-11-26.