Change Tell a Friend Form to Add Email Subject?

Events happening in the community are now at Drupal community events on www.drupal.org.
kristen pol's picture

I've googled quite a bit and haven't found anything about this. I would like to be able to add a Subject field to the "Tell a Friend" config form so that it will be used when sending the email.

I've been developing in Drupal for 6 years but am new to CiviCRM and don't grok how to "form_alter" CiviCRM forms... is this possible? An alternative would be to add a custom field to the contribution page settings and then pull that in the SubjectTemplate.tpl but I'm not sure how to pull in new data into the template in the proper way. Perhaps I'd have to do a db query directly from the tpl file?

Anyone know how to do this?

Thanks,
Kristen

Comments

Go for custom direcotry and cusom templates

Rajan M's picture

Hi Kristen,

CiviCRM provides some hooks (http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specifica...) and api (http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs) but in your case u cant not use this ,you have to modify some core files for that.
So I will strongly recommend you to go for custom directory and templates( http://wiki.civicrm.org/confluence/display/CRMDOC/Directories ).

You have to modify some files,
CRM/Friend/Form.php , buildQuickForm( ) method to add subject field, same field should be added in its template file also
and finally CRM/Friend/BAO/Friend.php , create( ) method to process email activity.

If you are new in CiviCRM then its looking somewhat difficult.

Cheers,
raj

Thanks!

kristen pol's picture

Thanks for the resources! I'll read up on this stuff... I just wish it was done the "Drupal way" so I didn't have to learn any new tricks ;)

Kristen

CiviCRM

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: