How does a person set the email a Formify submission comes from?
Permalink Browser Info Environment
Hello,
We have a quick question about the FROM email address that the formify notifications are coming from. Our emails are being marked as suspicious.
In the Code, this is initially hard coded to 'noreply@concrete5.org' in the "\packages\formify\src\FormifyNotification.php" page. We do then see that it references that it will overide this in the following statement
Our question is, where/how do we set the app.formify.from_address? It appears that if i could set it to the email I wanted, then this would help fix our issue. Your help would be appreciated.
We have a quick question about the FROM email address that the formify notifications are coming from. Our emails are being marked as suspicious.
In the Code, this is initially hard coded to 'noreply@concrete5.org' in the "\packages\formify\src\FormifyNotification.php" page. We do then see that it references that it will overide this in the following statement
if(Config::get('app.formify.from_address') != '') { $fromAddress = Config::get('app.formify.from_address'); }
Our question is, where/how do we set the app.formify.from_address? It appears that if i could set it to the email I wanted, then this would help fix our issue. Your help would be appreciated.
Type: | Ticket |
---|---|
Status: | Archived |
Thanks for the info. I had found those previous posts, but they do not seem to affect Formify.
In the lines of code is is as follows, which is hard coding the value in "\packages\formify\src\FormifyNotification.php"
As you can see above, the $fromaddress is getting hard coded in the Formify Package, but then makes reference to an ability to alter a Config value of some kind. We have tried to go to the concrete5 config file and update the email info as found here (https://documentation.concrete5.org/developers/sending-mail/configure-email-sender-addresses) but it doesn't change Formify's From address. If I change the hard coded value in the code above, it works properly, but I really don't want to alter the base code of Formify in case we update to a newer version in the future.
Does anyone know how to change this Config value?
In the lines of code is is as follows, which is hard coding the value in "\packages\formify\src\FormifyNotification.php"
public function send($record) { $this->record = $record; $fromAddress = 'noreply@concrete5.org'; if(Config::get('app.formify.from_address') != '') { $fromAddress = Config::get('app.formify.from_address'); } $fromName= $this->fromName; $to = $this->getDestination(); $reply = $this->getReply(); $subject = $this->subject; $t = \Concrete\Package\Formify\Src\FormifyTemplate::get($this->tID); $html = $t->render($record,true); if(($to != '') && ($subject != '')) { if($this->verifyCondition()) { $mh = Loader::helper('mail');
Viewing 15 lines of 26 lines. View entire code block.
As you can see above, the $fromaddress is getting hard coded in the Formify Package, but then makes reference to an ability to alter a Config value of some kind. We have tried to go to the concrete5 config file and update the email info as found here (https://documentation.concrete5.org/developers/sending-mail/configure-email-sender-addresses) but it doesn't change Formify's From address. If I change the hard coded value in the code above, it works properly, but I really don't want to alter the base code of Formify in case we update to a newer version in the future.
Does anyone know how to change this Config value?
Hi ,
I just successfully changed this for formify in the concrete 5 core.
Make sure that you change the correct core if you are running from update folder, the line is 332 in /concrete/config/concrete.php
This doesn't help when you update c5 of course.
Best
Phil
I just successfully changed this for formify in the concrete 5 core.
Make sure that you change the correct core if you are running from update folder, the line is 332 in /concrete/config/concrete.php
'address' => 'concrete5-noreply@concrete5', 'name' => '',
This doesn't help when you update c5 of course.
Best
Phil
We do see what you are doing there, but we are trying to not affect the core if we can help it so that if it gets updated, the changes are not rolled back.
The codebase shows something about accessing a Config for Formify, it is checking for it in the IF statement logic. Is there a way to update or create a file to be able to set this value for "app.formify.from_address"?
The codebase shows something about accessing a Config for Formify, it is checking for it in the IF statement logic. Is there a way to update or create a file to be able to set this value for "app.formify.from_address"?
Hi,
Altering the formify code is beyond my skill level.
In relation to Concrete5. I was being lazy and simply altered the setting in the core however, the way C5 is designed you should be able to add this as an override file in the application directory by putting the modified code in a concrete.php file in the config folder. This will be unaffected by a C5 update.
I imagine this setting will get updated in an upcoming formify update
Best
Phil
Altering the formify code is beyond my skill level.
In relation to Concrete5. I was being lazy and simply altered the setting in the core however, the way C5 is designed you should be able to add this as an override file in the application directory by putting the modified code in a concrete.php file in the config folder. This will be unaffected by a C5 update.
I imagine this setting will get updated in an upcoming formify update
Best
Phil
After poking around more, I think we may have found something that works that does not affect the c5 core. This change was found after dissecting the meaning of "app.formify.from_address" in the code logic above.
If you go into the following file: application > config > app.php
you can add the following key;
'formify' => ['from_address' => 'EMAIL GOES HERE']
This will change the FROM email for all Formify forms. So, if this change is made, you probably want it to be something generic. I am hoping this is the type of config file that the code references. Give this a try, see if it works for you!
If you go into the following file: application > config > app.php
you can add the following key;
'formify' => ['from_address' => 'EMAIL GOES HERE']
This will change the FROM email for all Formify forms. So, if this change is made, you probably want it to be something generic. I am hoping this is the type of config file that the code references. Give this a try, see if it works for you!
Thanks! I will try this and let you all know.
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.
To re-open this issue, reply to this message.
To re-open this issue, reply to this message.
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.
To re-open this issue, reply to this message.
To re-open this issue, reply to this message.
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.
To re-open this issue, reply to this message.
To re-open this issue, reply to this message.
Check out the two support requests below.
https://www.concrete5.org/marketplace/addons/formify/support/from-ad...
https://www.concrete5.org/marketplace/addons/formify/support/from-em...
There is no actual setting in formify to change this at the moment as far as I am aware (in spite of what it looks like in formify code), you need to change the setting in the C5 core.
Best
Phil