-
Notifications
You must be signed in to change notification settings - Fork 0
Services and functions 🧩
Send an email through a particular adapter (with headers 😉) -
\Souptik\WPMessaging\Email\send(
[ 'dev2@souptik.dev' ],
'Yay its working!',
'This is some long mail body.',
'Souptik',
'dev1@souptik.dev',
[
'cc' => [
[
'name' => 'CC Test',
'email' => 'cc@souptik.dev',
],
],
'attachments' => [
trailingslashit( WP_CONTENT_DIR ) . '/mu-plugins/test-wp-messaging.php',
'SameFileDifferentName.php' => trailingslashit( WP_CONTENT_DIR ) . '/mu-plugins/test-wp-messaging.php',
],
],
'mailgun'
);
Just remove the last parameter! And now it uses the default selected adapter -
\Souptik\WPMessaging\Email\send(
[ 'dev2@souptik.dev' ],
'Yay its working!',
'This is some long mail body.',
'Souptik',
'dev1@souptik.dev',
[
'cc' => [
[
'name' => 'CC Test',
'email' => 'cc@souptik.dev',
],
],
'attachments' => [
trailingslashit( WP_CONTENT_DIR ) . '/mu-plugins/test-wp-messaging.php',
'SameFileDifferentName.php' => trailingslashit( WP_CONTENT_DIR ) . '/mu-plugins/test-wp-messaging.php',
],
],
);
Checked the override wp_mail
checkbox? Try a simple wp_mail
! -
wp_mail(
[ 'dev2@souptik.dev' ],
'Yay its working!',
'This is some long mail body - from <strong>wp_mail</strong>.',
[],
[]
);
The interesting part of this plugin is that it only focuses on solving the smallest purpose it is created for in the most efficient way possible.
For almost all the email marketing/managing tool there is an option to select how you want to send the email (if there is none, then it by default uses wp_mail
), like these -
If you are using any other mailer/method in these plugins, just change to this default option and see how seamlessly wp-messaging
hooks in and sends emails reliably through your selected adapter! 😎
Send a SMS through a particular adapter -
\Souptik\WPMessaging\SMS\send( [ '+xxxxxxxxxxxx' ], 'Yay its working!', 'twilio' );
Just remove the last parameter! And now it uses the default selected adapter -
\Souptik\WPMessaging\SMS\send( [ '+xxxxxxxxxxxx' ], 'Yay its working!' );
Coming soon! ⏳