PluginProbe ʕ •ᴥ•ʔ
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin / 4.9.0
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin v4.9.0
4.9.0 0.9.6 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.6.0 1.6.2 1.7.0 1.7.1 1.8.0 1.8.1 1.9.0 2.0.0 2.0.1 2.1.1 2.2.1 2.3.1 2.4.0 2.5.0 2.5.1 2.6.0 2.7.0 2.8.0 2.9.0 3.0.1 3.0.2 3.0.3 3.1.0 3.10.0 3.11.0 3.11.1 3.2.0 3.2.1 3.3.0 3.4.0 3.5.0 3.5.1 3.5.2 3.6.1 3.7.0 3.8.0 3.8.2 3.9.0 4.0.1 4.1.0 4.1.1 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.8.0 trunk 0.10.0 0.10.1 0.11.1 0.11.2 0.3.1 0.3.2 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.5.2 0.6 0.7 0.8 0.8.2 0.8.3 0.8.4 0.8.5 0.8.6 0.8.7 0.9.0 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5
wp-mail-smtp / src / Providers / Mailjet / Options.php
wp-mail-smtp / src / Providers / Mailjet Last commit date
Mailer.php 6 days ago Options.php 6 days ago
Options.php
174 lines
1 <?php
2
3 namespace WPMailSMTP\Providers\Mailjet;
4
5 use WPMailSMTP\Helpers\UI;
6 use WPMailSMTP\Providers\OptionsAbstract;
7
8 /**
9 * Class Options.
10 *
11 * @since 4.2.0
12 */
13 class Options extends OptionsAbstract {
14
15 /**
16 * Mailer slug.
17 *
18 * @since 4.2.0
19 */
20 const SLUG = 'mailjet';
21
22 /**
23 * Options constructor.
24 *
25 * @since 4.2.0
26 *
27 * @param ConnectionInterface $connection The Connection object.
28 */
29 public function __construct( $connection = null ) {
30
31 if ( is_null( $connection ) ) {
32 $connection = wp_mail_smtp()->get_connections_manager()->get_primary_connection();
33 }
34
35 $description = sprintf(
36 wp_kses( /* translators: %1$s - URL to Mailjet.com site. */
37 __( '<a href="%1$s" target="_blank" rel="noopener noreferrer">Mailjet</a> is a cloud-based email service platform that enables businesses to send marketing and transactional emails, offering features like email automation, real-time analytics, and responsive design templates. If you\'re just starting out, you can send up to 200 emails per day without a credit card.', 'wp-mail-smtp' ) .
38 '<br><br>' .
39 /* translators: %2$s - URL to wpmailsmtp.com doc. */
40 __( 'To get started, read our <a href="%2$s" target="_blank" rel="noopener noreferrer">Mailjet documentation</a>.', 'wp-mail-smtp' ),
41 [
42 'strong' => true,
43 'br' => true,
44 'a' => [
45 'href' => true,
46 'rel' => true,
47 'target' => true,
48 ],
49 ]
50 ),
51 'https://www.mailjet.com/',
52 esc_url( wp_mail_smtp()->get_utm_url( 'https://wpmailsmtp.com/docs/how-to-set-up-the-mailjet-mailer-in-wp-mail-smtp/', 'Mailjet documentation' ) )
53 );
54
55 parent::__construct(
56 [
57 'logo_url' => wp_mail_smtp()->assets_url . '/images/providers/mailjet.svg',
58 'slug' => self::SLUG,
59 'title' => esc_html__( 'Mailjet', 'wp-mail-smtp' ),
60 'php' => '5.6',
61 'description' => $description,
62 'supports' => [
63 'from_email' => true,
64 'from_name' => true,
65 'return_path' => false,
66 'from_email_force' => true,
67 'from_name_force' => true,
68 ],
69 ],
70 $connection
71 );
72 }
73
74 /**
75 * Output the mailer provider options.
76 *
77 * @since 4.2.0
78 */
79 public function display_options() {
80
81 // Do not display options if PHP version is not correct.
82 if ( ! $this->is_php_correct() ) {
83 $this->display_php_warning();
84
85 return;
86 }
87 ?>
88
89 <!-- API Key -->
90 <div id="wp-mail-smtp-setting-row-<?php echo esc_attr( $this->get_slug() ); ?>-api_key"
91 class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text wp-mail-smtp-clear">
92 <div class="wp-mail-smtp-setting-label">
93 <label for="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-api_key"><?php esc_html_e( 'API Key', 'wp-mail-smtp' ); ?></label>
94 </div>
95 <div class="wp-mail-smtp-setting-field">
96 <?php if ( $this->connection_options->is_const_defined( $this->get_slug(), 'api_key' ) ) : ?>
97 <input type="text" disabled value="****************************************"
98 id="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-api_key"
99 />
100 <?php $this->display_const_set_message( 'WPMS_MAILJET_API_KEY' ); ?>
101 <?php else : ?>
102 <?php
103 $slug = $this->get_slug();
104 $value = $this->connection_options->get( $this->get_slug(), 'api_key' );
105
106 UI::hidden_password_field(
107 [
108 'name' => "wp-mail-smtp[{$slug}][api_key]",
109 'id' => "wp-mail-smtp-setting-{$slug}-api_key",
110 'value' => $value,
111 'clear_text' => esc_html__( 'Remove API Key', 'wp-mail-smtp' ),
112 ]
113 );
114 ?>
115 <?php endif; ?>
116
117 <p class="desc">
118 <?php
119 printf( /* translators: %s - link to get an API Key. */
120 esc_html__( 'Follow this link to get the API key from Mailjet: %s.', 'wp-mail-smtp' ),
121 '<a href="https://app.mailjet.com/account/apikeys" target="_blank" rel="noopener noreferrer">' .
122 esc_html__( 'API Key Management', 'wp-mail-smtp' ) .
123 '</a>'
124 );
125 ?>
126 </p>
127 </div>
128 </div>
129
130 <!-- Secret Key -->
131 <div id="wp-mail-smtp-setting-row-<?php echo esc_attr( $this->get_slug() ); ?>-secret_key"
132 class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text wp-mail-smtp-clear">
133 <div class="wp-mail-smtp-setting-label">
134 <label for="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-secret_key"><?php esc_html_e( 'Secret Key', 'wp-mail-smtp' ); ?></label>
135 </div>
136 <div class="wp-mail-smtp-setting-field">
137 <?php if ( $this->connection_options->is_const_defined( $this->get_slug(), 'secret_key' ) ) : ?>
138 <input type="text" disabled value="****************************************"
139 id="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-secret_key"
140 />
141 <?php $this->display_const_set_message( 'WPMS_MAILJET_SECRET_KEY' ); ?>
142 <?php else : ?>
143 <?php
144 $slug = $this->get_slug();
145 $value = $this->connection_options->get( $this->get_slug(), 'secret_key' );
146
147 UI::hidden_password_field(
148 [
149 'name' => "wp-mail-smtp[{$slug}][secret_key]",
150 'id' => "wp-mail-smtp-setting-{$slug}-secret_key",
151 'value' => $value,
152 'clear_text' => esc_html__( 'Remove Secret Key', 'wp-mail-smtp' ),
153 ]
154 );
155 ?>
156 <?php endif; ?>
157
158 <p class="desc">
159 <?php
160 printf( /* translators: %s - link to get an API Key. */
161 esc_html__( 'Follow this link to get the Secret key from Mailjet: %s.', 'wp-mail-smtp' ),
162 '<a href="https://app.mailjet.com/account/apikeys" target="_blank" rel="noopener noreferrer">' .
163 esc_html__( 'API Key Management', 'wp-mail-smtp' ) .
164 '</a>'
165 );
166 ?>
167 </p>
168 </div>
169 </div>
170
171 <?php
172 }
173 }
174