Send automatic email when placing customer in a customergroup

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

Solutions

<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
    } }

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.

Similar questions

Automatic Customer Group change based on VAT-ID: Force Magento to check and display message when customer gets to checkout page
I've been scratching my head over this specific problem for few days now. Let's start with basics: 1. Standard Domestic 2. Intra-European Union with UE-VAT Valid Verfication 3. Intra-European Union with UE-VAT INVALID VERIFICATION (Bad VAT ID or VEIS Server unavailable) Registration is completely disabled in shop. Only administrator can add anythin...
Additional Send Order Copy Email with different email template to other email address
There is 'Send Order Email Copy To' feature on sales email menu. I wand to add additional feature which I can set different email template and other email address. e.g.) Adding this menu, 'Send Order Email #2 To ' / 'Send Order Email #2 email template' How can I add this feature? Thank you!
Automatic email notification when a product is back in stock
I have activated the option "Sign up to get notified when this product is back in stock" Magento 1.9.1 give the possibility to subscibe to a product that is out of stock to let be informed by email when the product is available again. But Magento don't send email, i think it depends on cronjob. I also tried with this extions to manage cronjob http:...
Stop sending automatic invoice email on invoice creation
In my store, when I create an invoice and click on 'submit invoice',(not on 'send email') the invoice email is automatically sent to bcc email id (not to customer email) (ie; Sales Emails > Invoice > Send Invoice Email Copy To). And when I click on 'send email' then the invoice email is sent to customer and bcc(2nd time). I want to stop the first e...
How do I send a email from the cron job? Magento 2 Unable to send mail
I did create a cron job with custom sql query. It will send an email notification to our support email. Can someone tell me what's wrong my email coding, from the log it said I am unable to send mail? I had mageplaza SMTP setup, I am able to send testing email by using gmail SMTP this is the error
Magento - Can I send packing slip as email when order is placed and send together with order mail
when an order is placed the client receives an email and the order department gets a copy. The department would also like to be sent a packing slip as email straight away instead of having to print a pdf. So apart form the fact that I'd have to make an HTML template for the packing slip, how could I get Magento to send an other email AND use an oth...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.