You are viewing the PKP Support Forum | PKP Home Wiki

Registration Confirmation Email

OCS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, michael

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

Registration Confirmation Email

Postby shannah » Tue Mar 11, 2008 4:49 pm

I am using OCS 2.0 and noticed that there is no registration confirmation email for when a user registers for a conference. Email options already exist for:
1. When user creates an account.
2. When payment for registration is confirmed.

However we needed a step in the middle to just acknowledge to the registrant that we received their registration and are currently processing it. This is especially important when we are using the manual payment method.

**Note this is different than the solution documented at http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=3234 which sends a user confirmation email to the user if he registers for the site on the conference registration form. (For one thing, this email is only sent if the user hasn't registered for the site yet. If a current user tries to register for a conference, he receives no confirmation email).

Now that I have explained roughly the feature that I needed, I shall proceed into how it was done.

This is a patch against 2.0:
Code: Select all
--- classes/registration/form/UserRegistrationForm.inc.php   2008-03-03 12:38:59.000000000 -0800
+++ classes/registration/form/UserRegistrationForm.inc.php.new   2008-03-11 16:23:08.000000000 -0700
@@ -261,6 +261,28 @@ class UserRegistrationForm extends Form
       $paymentManager->displayPaymentForm($queuedPaymentId, $queuedPayment);
+      $schedConfName = $schedConf->getTitle();
+      $schedConfId = $schedConf->getSchedConfId();
+      $paramArray = array(
+         'registrantName' => $user->getFullName(),
+         'schedConfName' => $schedConfName,
+         'registrationType' => $registrationType->getSummaryString(),
+         'username' => $user->getUsername(),
+      );
+      import('mail.MailTemplate');
+      $mail = &new MailTemplate('REGISTRATION_CONFIRM');
+      if ( $mail and $mail->isEnabled() ){
+         $mail->setFrom($schedConf->getSetting('contactEmail', true), $schedConf->getSetting('contactName', true));
+         $mail->assignParams($paramArray);
+         $mail->addRecipient($user->getEmail(), $user->getFullName());
+         $mail->send();
+      }
       return true;

Then issue the following SQL commands to the database to add records for the REGISTRATION_CONFIRM email template:
Code: Select all
INSERT INTO  `email_templates_default_data` (  `email_key` ,  `locale` ,  `subject` ,  `body` ,  `description` )
'REGISTRATION_CONFIRM',  'en_US',  'Registration Confirmation',  'Dear {$registrantName},

Thank you for registering for {$schedConfName}.  Your registration details are as follows:


 You will be receiving an email shortly with further instructions.

{$principalContactSignature}', 'Email sent to registrant to confirm his registration request.  This is sent immediately after the user registers for a conference.'

Code: Select all
INSERT INTO `email_templates_default` (`email_key`, `can_disable`, `can_edit`, `from_role_id`, `to_role_id`) VALUES ('REGISTRATION_CONFIRM', 1, 1, NULL, NULL);

You can enable/disable and edit this confirmation email in the "Prepared Email" section of the Conference manager.

Hope this is helpful to someone.

Steve Hannah
Posts: 5
Joined: Tue May 29, 2007 10:04 am

Re: Registration Confirmation Email

Postby spatialguru » Thu Apr 03, 2008 9:34 am

This sounds like someone I need - thank you! Is it ready for production use? Will it also be part of 2.1 release?

Posts: 112
Joined: Mon Jun 25, 2007 1:23 pm
Location: British Columbia, Canada

Return to OCS Development

Who is online

Users browsing this forum: No registered users and 0 guests