1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
<?php
namespace AutomateWoo;
if ( ! defined( 'ABSPATH' ) ) { exit; }
/** * @class Action_Active_Campaign_Abstract */ abstract class Action_Campaign_Monitor_Abstract extends Action {
/** * Method to set the action's admin props. * * Admin props include: title, group and description. */ public function load_admin_details() { $this->group = __( 'Campaign Monitor', 'automatewoo' ); }
/** * @return Fields\Text */ public function get_subscriber_email_field() { $email = ( new Fields\Text() ) ->set_name( 'email' ) ->set_title( __( 'Subscriber email', 'automatewoo' ) ) ->set_description( __( 'You can use variables such as {{ customer.email }} here.', 'automatewoo' ) ) ->set_required() ->set_variable_validation(); return $email; }
/** * @return Fields\Text */ public function get_subscriber_name_field() { $email = ( new Fields\Text() ) ->set_name( 'name' ) ->set_title( __( 'Subscriber name', 'automatewoo' ) ) ->set_variable_validation(); return $email; }
/** * @return Fields\Select */ public function get_list_field() { $list = new Fields\Select(); $list->set_name( 'list' ); $list->set_title( __( 'List', 'automatewoo' ) ); $list->set_options( Integrations::campaign_monitor()->get_lists() ); $list->set_required(); return $list; }
/** * @return Fields\Checkbox */ public function get_resubscribe_field() { $field = new Fields\Checkbox(); $field->set_name( 'resubscribe' ); $field->set_title( __( 'Resubscribe', 'automatewoo' ) ); $field->set_description( __( 'If checked the user will be subscribed even if they have already unsubscribed from one of your lists. Use with caution.', 'automatewoo' ) ); return $field; } }
|