enter image description hereI created own module, there how to get sender name and email ?

I have to create custom admin config option like Email Sender. Here i used below code, to set drop-down then i don't know how to get store email and name in my controller.

    <label>Email Sender</label>
  • If you want to retrieve selected emails from this above code drop down then place all system.xml code – Aman Alam Jun 25 '16 at 6:44
  • Thank for your reply Aman Alam. but i dont know. Please mention system.xml code here – Sathiyabama Jun 25 '16 at 7:00

To retrive store sender name and email address :

General Contact

    /* Sender Name */
    /* Sender Email */

Sales Representative

    /* Sender Name */
    /* Sender Email */

Customer Support

    /* Sender Name */
    /* Sender Email */

Custom Email 1

    /* Sender Name */
    /* Sender Email */

Custom Email 2

    /* Sender Name */
    /* Sender Email */
  • i created own module, there how to get sender name and email ? – Sathiyabama Jun 25 '16 at 6:52
  • paste your all code of system.xml – Aman Alam Jun 25 '16 at 6:58
  • 2
    Store emails are unique if you need to use same don't need to replicate store email you can use above mentioned code to retrieve store emails if you need your own to set different email then you need to create fields for sender email and sender name and you able to retrieve each field by calling store config Mage::getStoreConfig(<section name>/<group name>/<field name>'); – Aman Alam Jun 25 '16 at 7:07
  • 2
    As i seen your screen shot seems your are in need to retrieve general contact email value from your module it work same as suggested you should Mage::getStoreConfig(<section name>/<group name>/outofstocknotification_admin_email'); update your section name and group name i only seen your field name so i have added that. – Aman Alam Jun 25 '16 at 7:10

You can retrieve store email address and store name in your module using the follow code

General Contact details

Get Sender Name


Get Sender Email


Reference source: https://magentoexplorer.com/get-magento-store-email-address-programmatically

$sender = Mage::getStoreConfig('<section_name>/<group_name>/outofstocknotification_admin_email');
$name = Mage::getStoreConfig('trans_email/ident_'.$sender.'/name');
$email = Mage::getStoreConfig('trans_email/ident_'.$sender.'/email');

This way you get the Name and Email of the store, according to your module choice.

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.