unsubscribe-form.php
72 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Template for the unsubscribe form in frontend. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 4.0.0 |
| 7 | */ |
| 8 | |
| 9 | if ( ! $ajax_step ) : ?> |
| 10 | <form class="hustle-unsubscribe-form"> |
| 11 | |
| 12 | <span |
| 13 | class="wpoi-submit-failure" |
| 14 | style="display:none;" |
| 15 | data-default-error="<?php esc_html_e( 'There was an error submitting the form', 'hustle' ); ?>" |
| 16 | ></span> |
| 17 | |
| 18 | <div class="hustle-form-body"> |
| 19 | |
| 20 | <div class="hustle-email-section"> |
| 21 | <input type="email" |
| 22 | name="email" |
| 23 | class="required" |
| 24 | placeholder="john@doe.com" > |
| 25 | </div> |
| 26 | |
| 27 | <button type="submit" class="hustle-unsub-button"> |
| 28 | <span class="hustle-loading-text"><?php echo esc_html( $messages['get_lists_button_text'] ); ?></span> |
| 29 | <span class="hustle-loading-icon"></span> |
| 30 | </button> |
| 31 | <input type="hidden" name="form_step" value="enter_email"> |
| 32 | |
| 33 | <input type="hidden" name="form_module_id" value="<?php echo esc_attr( $shortcode_attr_id ); ?>"> |
| 34 | <input type="hidden" name="current_url" value="<?php echo esc_attr( Opt_In_Utils::get_current_url() ); ?>"> |
| 35 | |
| 36 | </div> |
| 37 | |
| 38 | </form> |
| 39 | |
| 40 | <?php else : ?> |
| 41 | |
| 42 | <div class="hustle-email-lists"> |
| 43 | |
| 44 | <?php foreach ( $modules_id as $module_id ) : ?> |
| 45 | <?php |
| 46 | $current_module = new Hustle_Module_Model( $module_id ); |
| 47 | $list_name = __( 'Undefined', 'hustle' ); |
| 48 | if ( ! is_wp_error( $current_module ) ) { |
| 49 | $local_list = $current_module->get_provider_settings( 'local_list' ); |
| 50 | if ( ! empty( $local_list['local_list_name'] ) ) { |
| 51 | $list_name = $local_list['local_list_name']; |
| 52 | } |
| 53 | } |
| 54 | ?> |
| 55 | <label for="hustle-list-<?php echo esc_attr( $module_id ); ?>"> |
| 56 | <input type="checkbox" name="lists_id[]" value="<?php echo esc_attr( $module_id ); ?>" id="hustle-list-<?php echo esc_attr( $module_id ); ?>"> |
| 57 | <span><?php echo esc_html( $list_name ); ?></span> |
| 58 | </label> |
| 59 | |
| 60 | <?php endforeach; ?> |
| 61 | |
| 62 | </div> |
| 63 | <input type="hidden" name="form_step" value="choose_list"> |
| 64 | <input type="hidden" name="email" value="<?php echo esc_attr( $email ); ?>"> |
| 65 | <input type="hidden" name="current_url" value="<?php echo esc_attr( $current_url ); ?>"> |
| 66 | <button type="submit" class="hustle-unsub-button"> |
| 67 | <span class="hustle-loading-text"><?php echo esc_html( $messages['submit_button_text'] ); ?></span> |
| 68 | <span class="hustle-loading-icon"></span> |
| 69 | </button> |
| 70 | |
| 71 | <?php endif; ?> |
| 72 |