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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Sending email confirmation
Pages: [1]

Author Topic: Sending email confirmation  (Read 917 times)

mhenning

  • Guest
Sending email confirmation
April 12, 2010, 11:17:37 pm
I have a custom profile page for people to signup for a mailing list.  It collects email and name and what not and creates a contact record with the info.

After it is filled out, I would like to send a confirmation email to the person with the info they filled out.  Is there an easy way to do this?  Is there a hook I should listen for and are there some Mailing classes I could use (to take advantage of tokens).

Thanks,
Matt

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: Sending email confirmation
April 13, 2010, 07:15:44 am

Use

hook_civicrm_postProcess

you can use the function CRM_Utils_Mail::send

to do token replacement, check: CRM/Core/BAO/MessageTemplates.php, function sendReminder

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

mhenning

  • Guest
Re: Sending email confirmation
April 15, 2010, 03:57:48 pm
Thanks Lobo, that worked like a charm.

Another issue on this.  We currently have a textbox on the front page of our website where if you want to join the mailing list you fill in your email and click the sign up button.  This takes you to a second form where you fill in your name and other info, with the email box pre-populated.  Is there anyway to pre-populate values on a form?  Possibly by sending them in via URL?

Thanks,
Matt

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: Sending email confirmation
April 15, 2010, 04:02:13 pm

yes, send them in via the URL and them prepopulate them using the hook_civicrm_buildForm and retrieve the values from the $_GET array

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

mhenning

  • Guest
Re: Sending email confirmation
April 15, 2010, 04:03:47 pm
You are the man Lobo.  Thanks.

mhenning

  • Guest
Re: Sending email confirmation
April 15, 2010, 04:43:54 pm
Ok, got it working, but I have a confirmation email with tokens.  Works great for the fields on contact, but for my custom records that are on the Individual record they aren't showing up.  If I have a contact_id how do I get an array that includes the custom fields and Individual fields?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Sending email confirmation

This forum was archived on 2017-11-26.