Email library - Setting "from" via config. |
[eluser]TheFuzzy0ne[/eluser]
Hi everyone. I'd like to set my default Emailer settings using a config array, but looking at the from() method, if I supply a string like this: Admin <[email protected]> The Email address is extracted, but the name is ignored. Is there any way for me to get around this without having to call from() manually? I can override the from() method if necessary, but I just wanted to ensure I wasn't missing something painfully obvious.
[eluser]pistolPete[/eluser]
Where do you want to store the default email settings? Don't you have to call Code: from('[email protected]', 'Your Name');
[eluser]TheFuzzy0ne[/eluser]
It would be in the configuration file. This is the intialize() method from the Email class: Code: function initialize($config = array()) As you can see, if I set something like this: Code: $config['from'] = 'Admin <[email protected]>'; The string will be passed over to the from() method, and processed by it. I'm trying to avoid repeating calls to from() and reply_to() as I feel I should be able to just set them in my config file, and be done with it. I guess I should just stick with calling it manually, I just figured that seeing as the Email library supported this feature, I should be able to use it.
[eluser]pistolPete[/eluser]
Code: (...) $method = 'set_'.$key; (...)
[eluser]TheFuzzy0ne[/eluser]
Haha! I completely missed that line... Thanks for pointing that out, you've saved me a bit of a headache. |
Welcome Guest, Not a member yet? Register Sign In |