Edit or disable the customer registration email in LemonstandEdit or disable the customer registration email in Lemonstand

Posted February 12th, 2013 in LemonStand

When a customer registers their details on a Lemonstand ecommerce website, an email is sent to confirm the registration using the shop:registration_confirmation template. This post shows where to go to edit the email message or prevent it from being sent.

Editing the shop:registration_confirmation template

In the Lemonstand admin area, click "Email Templates" under "System > Settings".

This page shows you a list of email templates used by the system and you can edit any of them from here, modifying the subject, message body and the email address it's sent from.

To edit the shop:registration_confirmation template simply click it, make your changes and then click the "Save" button under the form. You can send a test message to yourself to see what it looks like before saving it if you wish.

There are a bunch of placeholders that can go in the email and these are shown in the right column sidebar next to the edit form.

Here's a screenshot of this form:

lemonstand registration confirmation email template

Disabling the shop:registration_confirmation template

There doesn't appear to be a way of disabling the email from being sent, other than to delete the template. I did search on the Lemonstand codebase for shop:registration_confirmation and found this section of code in the modules/shop/models/shop_customer.php file:

public function send_registration_confirmation()
{
	$template = System_EmailTemplate::create()->find_by_code('shop:registration_confirmation');
	if ($template)
	{
		$message = $this->set_customer_email_vars($template->content);
		$template->send_to_customer($this, $message);
	}
}

What it's doing is to query the database for the template. If the template exists, then it sends the email; if it doesn't, then it doesn't do anything.

So to disable the registration confirmation email in Lemonstand, delete the email template. Unfortunately you can't simply click the delete button on the edit form, because the system will not let you delete it and will show this error message: "This template is used by the Shop module".

To delete the template, run the following SQL query:

DELETE FROM system_email_templates
WHERE code = "shop:registration_confirmation"

If you do decide to delete this template, it would pay to keep a copy of the content of the email in case you want to restore it at some later time. The following SQL query can be run to restore the email to its default setting in case you have deleted it and need to restore it:

INSERT INTO `system_email_templates` (`code`, `subject`, `content`, `description`, `is_system`, `reply_to_mode`, `reply_to_address`) VALUES
('shop:registration_confirmation', 'Confirmation', '<p>Dear {customer_name}!</p>\n<p>Thank you for registering. Please use the following email and password to login:<br /> email:&nbsp;{customer_email}<br /> password: {customer_password}</p>', 'This message is sent to a customer after successful registration.', NULL, 'default', NULL);

Comments

blog comments powered by Disqus