Sterc / FormIt

A dynamic form processing Snippet for MODX Revolution
https://docs.modx.com/current/en/extras/formit
33 stars 58 forks source link

emailFromName fallback to site_name #103

Closed jpdevries closed 8 years ago

jpdevries commented 8 years ago

first looks for emailFromName in settings then in $this->formit->config then looks for site_name in settings

finally falls back to $emailFrom

NOTE: This may be considered a breaking change depending on how you look at it

See Sterc/FormIt#101

joeke commented 8 years ago

@jpdevries Thanks! Not entirely sure if the logic is correct though; as I see it it could be simplified a bit like the following:

$emailFromName = $this->modx->getOption('emailFromName', $this->formit->config, $this->modx->getOption('site_name', null, $emailFrom));

So first look for the emailFromName in your Formit config, then look for site_name in system settings, and finally fallback to emailFrom in Formit config.

jpdevries commented 8 years ago

@joeke makes sense. Wasn't sure if it should fallback to the site_name before $emailFrom or not