1

I've been searching for a way to send an automatic email when placing a customer in a certain customergroup. I have had no luck finding exactly how to get that done if it's even possible. Suggestions with programming or through an extension would be welcome

3

It ought to be possible to hook into the customer_save_after or adminhtml_customer_save_after event, then compare getData('customer_group_id') vs getOrigData('customer_group_id') to see whether it was changed. If then the customer group Id fits the ID of the customer group you want to send the email for, you can use the Zend mail

$mail = new Zend_Mail();
$mail->setFrom("fromemail","fromname");
$mail->addTo("toemail","toname");
$mail->setSubject("subject");
$mail->setBodyHtml(" body text")
$mail->send();

to send the email.

Didn't test this yet, though.

2
<global>
    <events>
        <customer_save_after>
            <observers>
                <yourmodelobserver>
                    <type>singleton</type>
                    <class>yourmodel/observer</class>
                    <method>mysendmail</method>
                </yourmodelobserver>
            </observers>
        </customer_save_after>
    </events>
</global>

php code

    mysendmail($object){

     if ($object->getData('group_id') != $object->getOrigData('group_id')) {
//send mail
    } }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.