0

I want send an email at installation time of the extension. But didn't find any solution yet. Any help will be appreciated.

  • In which installation step you want to send the email? – Akhil Gupta Dec 2 '15 at 10:08
  • Once any user install my extension an email should send from their server to any specific id. – Atul Dec 2 '15 at 10:15
0

You can add your email function in SQL setup file of the extension, so it will send email upon installation.

If you can manage it through database by making an entry that will be good.

0

You can provide a setup script with your extension and add your email code in there. It will automatically fire upon installation.

http://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-6.html

0

This way you could proceed:

Use observer controller_action_layout_load_before (This will fire on each page load)

Inside it use below code:

public function sendEmail() {

    $isEmailSent = 0; /* get Dynamic value from DB */

    if ($isEmailSent == 0) {
        $modules = Mage::getConfig()->getNode('modules')->children();
        $allInstalledModules = (array) $modules;

        if (isset($allInstalledModules['Your_Module'])) {
            /* Your email code here */
            /* Set some value in db as  $isEmailSent=1 */
        }
    }
}

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.