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
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
acuityWebsiteC5
View Replies:
PhilYoung replied on at Permalink Reply
PhilYoung
Hi,

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
acuityWebsiteC5 replied on at Permalink Reply
acuityWebsiteC5
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"

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');



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?
PhilYoung replied on at Permalink Reply
PhilYoung
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

'address' => 'concrete5-noreply@concrete5',
            'name' => '',


This doesn't help when you update c5 of course.

Best
Phil
acuityWebsiteC5 replied on at Permalink Reply
acuityWebsiteC5
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"?
PhilYoung replied on at Permalink Reply
PhilYoung
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
acuityWebsiteC5 replied on at Permalink Reply
acuityWebsiteC5
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!
lesccseh replied on at Permalink Reply
lesccseh
Thanks! I will try this and let you all know.
ConcreteCMS replied on at Permalink Reply
ConcreteCMS
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.
ConcreteCMS replied on at Permalink Reply
ConcreteCMS
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.
ConcreteCMS replied on at Permalink Reply
ConcreteCMS
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.

concrete5 Environment Information

# concrete5 Version
Core Version - 8.2.1
Version Installed - 8.2.1
Database Version - 20170802000000

# concrete5 Packages
Block Designer (2.8.2), Formify (2.6.4), Office/Providers Package (0.0.10)

# concrete5 Overrides
blocks/autonav/templates/breadcrumb.php, blocks/autonav/templates/main_menu/view.php, blocks/autonav/templates/main_menu, blocks/autonav/templates, blocks/autonav/view.php, blocks/autonav, blocks/featured_block/add.php, blocks/featured_block/composer.php, blocks/featured_block/config.json, blocks/featured_block/controller.php, blocks/featured_block/db.xml, blocks/featured_block/edit.php, blocks/featured_block/form.php, blocks/featured_block/icon.png, blocks/featured_block/templates/icon.php, blocks/featured_block/templates, blocks/featured_block/view.php, blocks/featured_block, blocks/formify_form/templates/acuity.php, blocks/formify_form/templates, blocks/formify_form, blocks/homepage_banner/add.php, blocks/homepage_banner/composer.php, blocks/homepage_banner/config.json, blocks/homepage_banner/controller.php, blocks/homepage_banner/db.xml, blocks/homepage_banner/edit.php, blocks/homepage_banner/form.php, blocks/homepage_banner/icon.png, blocks/homepage_banner/view.php, blocks/homepage_banner, blocks/homepage_intro/add.php, blocks/homepage_intro/composer.php, blocks/homepage_intro/config.json, blocks/homepage_intro/controller.php, blocks/homepage_intro/db.xml, blocks/homepage_intro/edit.php, blocks/homepage_intro/form.php, blocks/homepage_intro/icon.png, blocks/homepage_intro/view.php, blocks/homepage_intro, blocks/search/controller.php, blocks/search/templates/blogsearch/view.php, blocks/search/templates/blogsearch, blocks/search/templates/pagesearch/view.php, blocks/search/templates/pagesearch, blocks/search/templates, blocks/search/view.css, blocks/search, blocks/social_media_block/add.php, blocks/social_media_block/composer.php, blocks/social_media_block/config.json, blocks/social_media_block/controller.php, blocks/social_media_block/db.xml, blocks/social_media_block/edit.php, blocks/social_media_block/form.php, blocks/social_media_block/icon.png, blocks/social_media_block/view.php, blocks/social_media_block, single_pages/page_not_found.php, themes/acuity/css/animation.css, themes/acuity/css/bootstrap.min.css, themes/acuity/css/custom.css, themes/acuity/css/font-awesome.min.css, themes/acuity/css/slick.css, themes/acuity/css, themes/acuity/description.txt, themes/acuity/fonts/fontawesome-webfont.eot, themes/acuity/fonts/fontawesome-webfont.svg, themes/acuity/fonts/fontawesome-webfont.ttf, themes/acuity/fonts/fontawesome-webfont.woff, themes/acuity/fonts/fontawesome-webfont.woff2, themes/acuity/fonts/FontAwesome.otf, themes/acuity/fonts/glyphicons-halflings-regular.eot, themes/acuity/fonts/glyphicons-halflings-regular.svg, themes/acuity/fonts/glyphicons-halflings-regular.ttf, themes/acuity/fonts/glyphicons-halflings-regular.woff, themes/acuity/fonts/glyphicons-halflings-regular.woff2, themes/acuity/fonts, themes/acuity/full.php, themes/acuity/home.php, themes/acuity/img/bkg-cali.jpg, themes/acuity/img/bkg-hdr.jpg, themes/acuity/img/cali-map.jpg, themes/acuity/img/chewie.jpg, themes/acuity/img/doctor-1.jpg, themes/acuity/img/doctor-2.jpg, themes/acuity/img/doctor-3.jpg, themes/acuity/img/doctor-4.jpg, themes/acuity/img/doctor-5.jpg, themes/acuity/img/doctor-6.jpg, themes/acuity/img/feature-1.jpg, themes/acuity/img/feature-10.jpg, themes/acuity/img/feature-2.jpg, themes/acuity/img/feature-3.jpg, themes/acuity/img/feature-4.jpg, themes/acuity/img/feature-5.jpg, themes/acuity/img/feature-6.jpg, themes/acuity/img/feature-7.jpg, themes/acuity/img/feature-8.jpg, themes/acuity/img/feature-9.jpg, themes/acuity/img/gradient.jpg, themes/acuity/img/hdr-1.jpg, themes/acuity/img/hdr-2.jpg, themes/acuity/img/hdr-3.jpg, themes/acuity/img/hdr-colors.jpg, themes/acuity/img/hdr-short.jpg, themes/acuity/img/hero-1.jpg, themes/acuity/img/hero-2.jpg, themes/acuity/img/hills.jpg, themes/acuity/img/logo-inverse.png, themes/acuity/img/logo-og.png, themes/acuity/img/logo-retina.jpg, themes/acuity/img/logo-retina.png, themes/acuity/img/logo-stamp.png, themes/acuity/img/logo.png, themes/acuity/img/quotes.png, themes/acuity/img/scroll.png, themes/acuity/img/service-1.jpg, themes/acuity/img/service-2.jpg, themes/acuity/img/service-3.jpg, themes/acuity/img/service-4.jpg, themes/acuity/img/service-5.jpg, themes/acuity/img/service-6.jpg, themes/acuity/img/slide-1.jpg, themes/acuity/img/slide-2.jpg, themes/acuity/img/square-2.png, themes/acuity/img/squares.png, themes/acuity/img, themes/acuity/inc/footer.php, themes/acuity/inc/header.php, themes/acuity/inc, themes/acuity/js/bootstrap.js, themes/acuity/js/bootstrap.min.js, themes/acuity/js/cycle2.min.js, themes/acuity/js/npm.js, themes/acuity/js/slick.js, themes/acuity/js, themes/acuity/page_theme.php, themes/acuity/secondary_gray.php, themes/acuity/secondary_twocol.php, themes/acuity/thumbnail.png, themes/acuity/view.php, themes/acuity

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
7.1.10

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dom, fileinfo, filter, gd, gettext, hash, iconv, intl, json, libxml, mbstring, mcrypt, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, Phar, readline, Reflection, session, SimpleXML, soap, SPL, sqlsrv, standard, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 360
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 10000
memory_limit - 1548M
post_max_size - 20M
sql.safe_mode - Off
upload_max_filesize - 25M
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
opcache.max_accelerated_files - 100000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.