Newsletter Builder 3 - Additional Fields

By Ryan - September 18, 2014 - edited: September 23, 2014

Is there anyway to add additional fields to the subscribe form on Newsletter Builder 3?

I want to add in first name, last name, telephone etc. It only seems to work with an email address.


RESOLVED!

May not be the best solution but it works. See updated file attached. Hope this helps.


Edited the following file

plugins/newsletterBuilder/newsletterBuilder.php


Around line 130 - added the following validation rules

    if     (!@$_REQUEST['salutation'])              { $errorsAndAlerts .= t("No title specified!") . "<br/>\n"; }
    if     (!@$_REQUEST['first_name'])              { $errorsAndAlerts .= t("No firstname specified!") . "<br/>\n"; }
    if     (!@$_REQUEST['last_name'])              { $errorsAndAlerts .= t("No surname specified!") . "<br/>\n"; }
    if     (!@$_REQUEST['mobile'])              { $errorsAndAlerts .= t("No mobile specified!") . "<br/>\n"; }

Around line 690 - I defined the following additional variables

 $first_name = ucfirst(strtolower($_REQUEST['first_name']));
  $last_name = ucfirst(strtolower($_REQUEST['last_name']));
  $mobile = $_REQUEST['mobile'];
  $salutation = $_REQUEST['salutation'];

And finally around line 708 - I included the additional $colsToValues values in the sql insert.

 $colsToValues['salutation'] = $salutation;
 $colsToValues['first_name'] = $first_name;
 $colsToValues['last_name'] = $last_name;
 $colsToValues['mobile'] = $mobile;

Attachments:

newsletterBuilder.php 42K