Plugin yìí kò tíì ṣe àyẹ̀wò pẹ̀lú àwọn ìtújáde mẹ́ta pàtàkì tó kẹ́yìn ti WordPress. Ó lè jẹ́ pé a kò tọ́jú tàbí ṣe àtìlẹ́yìn fún un mọ́, ó sì lè ní àwọn ọ̀ràn ìbámu nígbà tí a bá lò ó pẹ̀lú àwọn ẹ̀yà WordPress tuntun.

All Path Messaging

Àpèjúwe

Check out the Github Repository ♥

Limitless Communication: All-in-one, super scalable, messaging Solution for WordPress.

Ok hold on! ✋. So, many words in one line.
LetÌtumọ̀ Yorùbá: ’s understand each one-by-one.

  • All-in-one: What do you want? Ìtumọ̀ Yorùbá: – Email, SMS, push-notification? Get all-in-one.
    • But I donÌtumọ̀ Yorùbá: ’t want to use xyz provider for SMS, I want to use pqr, can I have that? Yes it provides you with lot of pre implemented providers for all email, sms and push-notification.
  • Super Scalable: But I want to use an email provider named yxr you havenÌtumọ̀ Yorùbá: ’t heard the name of. Now what? 🧐
    • No worries! Are you a developer? If yes, just write your own plugin and implement your own adapter and see it nicely hooked-up with “WordPress messaging”. Please refer to this section for implementing adapters.

And thatÌtumọ̀ Yorùbá: ’s how it provides Limitless communication! 🚀

Quick Links

Setup ⚙️ | Issues | Services and functions 🧩 | Create your own Adapter 🛠️

Coming soon ⏳

  • Push notifications
  • Email Testing page
  • SMS Testing page
  • Push notifications Testing page

Examples

Email 📧📨

Send an email through a particular adapter (with headers 😉) Ìtumọ̀ Yorùbá: –

\Souptik\AllPathMessaging\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-all-path-messaging.php',
     'SameFileDifferentName.php' => trailingslashit( WP_CONTENT_DIR ) . '/mu-plugins/test-all-path-messaging.php',
   ],
  ],
  'mailgun'
 );

Just remove the last parameter! And now it uses the default selected adapter Ìtumọ̀ Yorùbá: –

\Souptik\AllPathMessaging\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-all-path-messaging.php',
     'SameFileDifferentName.php' => trailingslashit( WP_CONTENT_DIR ) . '/mu-plugins/test-all-path-messaging.php',
   ],
  ],
 );

Checked the override wp_mail checkbox? Try a simple wp_mail! Ìtumọ̀ Yorùbá: –

wp_mail(
  [ 'dev2@souptik.dev' ],
  'Yay its working!',
  'This is some long mail body - from <strong>wp_mail</strong>.',
  [],
  []
 );

SMS 📲

Send a SMS through a particular adapter Ìtumọ̀ Yorùbá: –

\Souptik\AllPathMessaging\SMS\send( [ '+xxxxxxxxxxxx' ], 'Yay its working!', 'twilio' );

Just remove the last parameter! And now it uses the default selected adapter Ìtumọ̀ Yorùbá: –

\Souptik\AllPathMessaging\SMS\send( [ '+xxxxxxxxxxxx' ], 'Yay its working!' );

Creating your own adapter 🛠️

Here comes the cool part fellow developers! 💻

Tip: I have provided a dummy adapter for each service at inc/<service>/adapters/dummy/.

Consider that as the starting point and letÌtumọ̀ Yorùbá: ’s understand what each file does.

  • LetÌtumọ̀ Yorùbá: ’s start with namespace.php. It is the entry point of your adapter.
    • In that you will see a simple bootstrap function.
    • In that function we are hooking into EMAIL_SLUG . '_adapters' and registering our adapter.
    • We pass the following data Ìtumọ̀ Yorùbá: –
    • slug
    • name
    • adapter class object.
    • options Ìtumọ̀ Yorùbá: – An array defining the settings required for this adapter, which will be used to automatically display the options on the settings page.
  • Next is class-adapter.php, which is the Adapter class, which we initialized in the above file and passed it to adapter. It contains three simple functions Ìtumọ̀ Yorùbá: –
    • get_settings_fields Ìtumọ̀ Yorùbá: – This is the function which returns the array of options, which we used in the above file for options. Each option, will have Ìtumọ̀ Yorùbá: –
    • The key as the name of the option.
    • And three values Ìtumọ̀ Yorùbá: –
      • label Ìtumọ̀ Yorùbá: – Label to display in the settings page beside the input.
      • type Ìtumọ̀ Yorùbá: – Type of the field.
      • sanitize_callback
    • get_settings Ìtumọ̀ Yorùbá: – This function returns an associative array, whose keys are the name of the options and the value as the value of the options.
    • get_adapter Ìtumọ̀ Yorùbá: – This function will just return the core provider class, which is responsible for processing the message.
    • First check if Utopia Messaging already provides the provider or not here, for example Utopia\Messaging\Adapter\Email\Mailgun.
    • If it is present just use it. Easy peasy! ✨
    • But if not, letÌtumọ̀ Yorùbá: ’s code it ourself, because Utopia Messaging makes it so easy to create a new adapter!
  • class-dummy.php is for that purpose, assuming you donÌtumọ̀ Yorùbá: ’t get a provider already present in Utopia Messaging.
    • ItÌtumọ̀ Yorùbá: ’s basically a child class of EmailAdapter or SMSAdapter, which abstract a lot of stuff for us!
    • Let me explain two main functions, _construct and process. Rest of the functions and properties are self-explanatory! 😉
    • In the _construct function just put the arguments which you want to accept. ThatÌtumọ̀ Yorùbá: ’s it! And now they will be available everywhere else as $this->param_name!
    • The process function is the place where you have to write the main logic of calling your providers API to send the message.
      • As said above all the credentials/data you accepted through constructor are available as $this->param_name.
      • Build the body and the headers.
      • And then you can use the $this->request function as demonstrated in the dummy!
      • Create a response using UtopiaÌtumọ̀ Yorùbá: ’s Response class.
      • Handle the errors, populate the response, return! Done! 🚀

External services

Brevo

This plugin connectÌtumọ̀ Yorùbá: ’s to BrevoÌtumọ̀ Yorùbá: ’s API to send emails through Brevo. This is the API it sends the request to.
The request is send everytime a mail is sent, and Brevo is selected as the default adapter from the plugin settings (or the function to send email through Brevo is directly invoked in the code).
Here is the Terms of Use and Privacy Policy of the service.

AWS SES

This plugin connectÌtumọ̀ Yorùbá: ’s to AWS SESÌtumọ̀ Yorùbá: ’s API to send emails through AWS SES.
The request is send everytime a mail is sent, and AWS SES is selected as the default adapter from the plugin settings (or the function to send email through AWS SES is directly invoked in the code).
Here is the Terms of Use and Privacy Policy of the service.

Mailgun

This plugin connectÌtumọ̀ Yorùbá: ’s to MailgunÌtumọ̀ Yorùbá: ’s API to send emails through Mailgun.
The request is send everytime a mail is sent, and Mailgun is selected as the default adapter from the plugin settings (or the function to send email through Mailgun is directly invoked in the code).
Here is the Terms of Use and Privacy Policy of the service.

Telesign

This plugin connectÌtumọ̀ Yorùbá: ’s to TelesignÌtumọ̀ Yorùbá: ’s API to send SMS through Telesign.
The request is send everytime the function to send SMS is invoked with the Adapter as Telesign or the default adapter is set as Telesign.
Here is the Terms of Use and Privacy Policy of the service.

Twilio

This plugin connectÌtumọ̀ Yorùbá: ’s to TwilioÌtumọ̀ Yorùbá: ’s API to send SMS through Twilio.
The request is send everytime the function to send SMS is invoked with the Adapter as Twilio or the default adapter is set as Twilio.
Here is the Terms of Use and Privacy Policy of the service.

Àwọn àwòrán ìbòjú

  • WordPress Options (Email)
  • WordPress Options (SMS)

Ìgbéwọlẹ̀

Upload ‘all-path-messaging’ to the ‘/wp-content/plugins/’ directory.

Activate the plugin through the ‘Plugins’ menu in WordPress.

FAQ

I have a codebase, where I have used `wp_mail`. Do I need to make any changes to the codebase after installing this plugin?

Good news Ìtumọ̀ Yorùbá: – no!
You just have to check the Override wp_mail functionality checkbox in the settings and thatÌtumọ̀ Yorùbá: ’s it! All your mails you are triggering through wp_mail will be sent through your selected provider!

I am already using an email marketing plugin. Can I use this plugin to use as the email sending service?

Absolutely!
The plugin is made for that only! Keep using your existing email marketing plugin and just set the email provider as default (i.e it should use wp_mail). And thatÌtumọ̀ Yorùbá: ’s it the emails will be send through the desired provider you select in this plugin.

I need a provider called `xyz`, which is not present currently in this plugin. Do I have to ask you to integrate that?

If you know coding! Ìtumọ̀ Yorùbá: – You donÌtumọ̀ Yorùbá: ’t have to wait for it! Go ahead and create your own adapter in your plugin by extending this plugin.
If you are non-tech! Ìtumọ̀ Yorùbá: – Please create an issue over here, and I will try to integrate the provider ASAP.

Àwọn àgbéyẹ̀wò

Kò sí àwọn àgbéyẹ̀wò fún plugin yìí.

Àwọn Olùkópa & Olùgbéejáde

“All Path Messaging” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí ti ṣe ìkópa sí plugin yìí.

Àwọn Olùkópa

Túmọ̀ “All Path Messaging” sí èdè rẹ.

Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?

Ṣàwárí koodu, ṣàyẹ̀wò ibi ìpamọ́ SVN, tàbí ṣe àgbékalẹ̀ sí àkọsílẹ̀ ìdàgbàsókè nípasẹ̀ RSS.

Àkọsílẹ̀ àwọn àyípadà

1.0.0

  • First stable release.