Can newsletter plugin reject yahoo or gmail (free email) account?
2 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: June 4, 2015 (RSS)
By esupport - June 4, 2015
HI
About newsletter plugin.
We don't want user use free email. Only want they use their company email.
Can newsletter plugin reject yahoo or gmail (free email) account?
Other question:
Is it possible to have other fields like customer name, company name , email and some users information on newsletter subscribe page?
Thanks!
By gkornbluth - June 4, 2015 - edited: June 4, 2015
Hi jh
I don't use the newsletter plugin, but I assume that there's some error checking code on the subscribe page.
You should be able to add something similar to this in the error checking section of the subscribe page to check for the existence of yahoo or gmail in the email_address field. (change the code to match the name of your email address field and company name )
if (strpos(@$_REQUEST['email_address'], 'yahoo') || strpos(@$_REQUEST['email_address'], 'gmail')) { $errorsAndAlerts .= "You can only receive newsletters at your company email address!<br/>\n"; }
Also, you can add any fields that you want to your form, but you'll have to create the new fields in your section editor as well.
Copy the format for other similar fields on the subscribe page and in the form, and change the field names.
So, assuming there's a text field where you enter the first name which is called first_name, you should find something similar to:
first_name = '".mysql_escape( $_REQUEST['first_name'] )."',
Copy that, and insert the copy right below the original line of code.
Then change the field name to match your new field name.
NOTE the last line of these has a different ending then the others.
In the form itself, copy the code that relates to entering the first name and insert it where you want the new field to occur, then change text and field names as appropriate.
If you have any issues with the code, please post the actual code you're using and what the errors were. (Don't include any passwords, usernames, or other security information.)
Hope that helps,
Jerry Kornbluth
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php