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` )
VALUES (
'REGISTRATION_CONFIRM', 'en_US', 'Registration Confirmation', 'Dear {$registrantName},
Thank you for registering for {$schedConfName}. Your registration details are as follows:
Category:
{$registrationType}
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
shannah@sfu.ca
