| @@ -6,12 +6,12 @@ | ||
| 6 | 6 | use HTML_Forms\Submission; |
| 7 | 7 | |
| 8 | 8 | class MailChimp extends Action { |
| 9 | 9 | public $type = 'mailchimp'; |
| 10 | - public $label = 'Mailchimp'; | |
| 10 | + public $label = 'MailChimp'; | |
| 11 | 11 | |
| 12 | 12 | public function __construct() { |
| 13 | - $this->label = __( 'Mailchimp', 'html-forms' ); | |
| 13 | + $this->label = __( 'MailChimp', 'html-forms' ); | |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * @return array |
| @@ -40,14 +40,8 @@ | ||
| 40 | 40 | <?php if ( ! empty( $selected_list ) ) { ?> |
| 41 | 41 | <span class="hf-action-summary"><?php printf( __( 'Subscribe to %s', 'html-forms' ), $selected_list->name ); ?></span> |
| 42 | 42 | <?php } ?> |
| 43 | 43 | <input type="hidden" name="form[settings][actions][<?php echo $index; ?>][type]" value="<?php echo $this->type; ?>" /> |
| 44 | - | |
| 45 | - <p class="description"> | |
| 46 | - <?php _e( 'Add an email address to the assigned Mailchimp list when this form is sucessfully submitted.', 'html-forms' ); ?> | |
| 47 | - <a target="_blank" tabindex="-1" class="html-forms-help" href="https://htmlformsplugin.com/kb/add-users-to-a-mailchimp-list/"><span class="dashicons dashicons-editor-help"></span></a> | |
| 48 | - </p> | |
| 49 | - | |
| 50 | 44 | <table class="form-table"> |
| 51 | 45 | <tr valign="top"> |
| 52 | 46 | <th scope="row"><?php _e( 'List', 'html-forms' ); ?></th> |
| 53 | 47 | <td> |
| @@ -52,9 +46,9 @@ | ||
| 52 | 46 | <th scope="row"><?php _e( 'List', 'html-forms' ); ?></th> |
| 53 | 47 | <td> |
| 54 | 48 | <?php if ( ! empty( $lists ) ) { ?> |
| 55 | 49 | <select name="form[settings][actions][<?php echo $index; ?>][list_id]"> |
| 56 | - <option value="" style="color: #AAA;" readonly><?php _e( 'Select Mailchimp list', 'html-forms' ); ?></option> | |
| 50 | + <option value="" style="color: #AAA;" readonly><?php _e( 'Select MailChimp list', 'html-forms' ); ?></option> | |
| 57 | 51 | <?php |
| 58 | 52 | foreach ( $lists as $list ) { |
| 59 | 53 | $selected = $settings['list_id'] === $list->id ? 'selected' : ''; |
| 60 | 54 | echo sprintf( '<option value="%s" %s>%s</option>', $list->id, $selected, $list->name ); |
| @@ -62,9 +56,9 @@ | ||
| 62 | 56 | ?> |
| 63 | 57 | </select> |
| 64 | 58 | <?php |
| 65 | 59 | } else { |
| 66 | - echo '<p><a href="' . admin_url( 'admin.php?page=mailchimp-for-wp' ) . '">' . __( 'Please connect your Mailchimp account first.', 'html-forms' ) . '</a></p>'; | |
| 60 | + echo '<p><a href="' . admin_url( 'admin.php?page=mailchimp-for-wp' ) . '">' . __( 'Please connect your MailChimp account first.', 'html-forms' ) . '</a></p>'; | |
| 67 | 61 | } |
| 68 | 62 | ?> |
| 69 | 63 | </td> |
| 70 | 64 | |
| @@ -82,9 +76,9 @@ | ||
| 82 | 76 | $email_address = ''; |
| 83 | 77 | |
| 84 | 78 | // find email field |
| 85 | 79 | foreach ( $submission->data as $field => $value ) { |
| 86 | - if ( is_string( $value ) && is_email( $value ) ) { | |
| 80 | + if ( is_email( $value ) ) { | |
| 87 | 81 | $email_address = $value; |
| 88 | 82 | } |
| 89 | 83 | } |
| 90 | 84 | |