I am creating a custom module with a custom database table using the following tutorial.
This module is a custom contact form, and I would like the settings for that custom contact form to be on a per store basis, meaning, I want the send from email address to be different for each store I create.
Do I need to add specific fields to the database for Magento to pick up on this? Or does Magento do this automagically?
Best Answer
You could use the existing behavior of Magento which allows to define and get a contact email address for each store view and depending on the department (sales, customer support, general). You can then use theses specific contact per store view in your custom module.
Here is the configuration backend for email addresses:
And to use this specific email in your custom module, the important part in your case is the
$sender
variable. Here is a code sample (check the comment in it, be aware that it is taken from a code of me, so adapt to your needs):