{"id":208981,"date":"2024-10-15T19:21:30","date_gmt":"2024-10-15T19:21:30","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/all-in-one-messaging\/"},"modified":"2024-10-27T08:19:28","modified_gmt":"2024-10-27T08:19:28","slug":"all-path-messaging","status":"publish","type":"plugin","link":"https:\/\/pcd.wordpress.org\/plugins\/all-path-messaging\/","author":20329686,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.0","stable_tag":"1.0.0","tested":"6.6.5","requires":"4.4","requires_php":"5.6","requires_plugins":null,"header_name":"All Path Messaging","header_author":"Souptik Datta","header_description":"Limitless Communication: All-in-One, super scalable, messaging Solution for WordPress.","assets_banners_color":"b0bbea","last_updated":"2024-10-27 08:19:28","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/profiles.wordpress.org\/souptik\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":1062,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"souptik","date":"2024-10-27 08:19:28"}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-256x256.png":{"filename":"icon-256x256.png","revision":3169533,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3169533,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3169568,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3169533,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3169533,"resolution":"2","location":"assets","locale":""}},"screenshots":{"1":"WordPress Options (Email)","2":"WordPress Options (SMS)"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[267,2512,7291,711],"plugin_category":[41],"plugin_contributors":[220470],"plugin_business_model":[],"class_list":["post-208981","plugin","type-plugin","status-publish","hentry","plugin_tags-email","plugin_tags-messaging","plugin_tags-push-notification","plugin_tags-sms","plugin_category-communication","plugin_contributors-souptik","plugin_committers-souptik"],"banners":{"banner":"https:\/\/ps.w.org\/all-path-messaging\/assets\/banner-772x250.png?rev=3169568","banner_2x":"https:\/\/ps.w.org\/all-path-messaging\/assets\/banner-1544x500.png?rev=3169533","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/all-path-messaging\/assets\/icon-256x256.png?rev=3169533","icon_2x":"https:\/\/ps.w.org\/all-path-messaging\/assets\/icon-256x256.png?rev=3169533","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/all-path-messaging\/assets\/screenshot-1.png?rev=3169533","caption":"WordPress Options (Email)"},{"src":"https:\/\/ps.w.org\/all-path-messaging\/assets\/screenshot-2.png?rev=3169533","caption":"WordPress Options (SMS)"}],"raw_content":"<!--section=description-->\n<p><a href=\"https:\/\/github.com\/Souptik2001\/all-path-messaging\">Check out the Github Repository \u2665<\/a><\/p>\n\n<p><strong>Limitless Communication:<\/strong> All-in-one, super scalable, messaging Solution for WordPress.<\/p>\n\n<p>Ok hold on! \u270b. So, many words in one line.\nLet's understand each one-by-one.<\/p>\n\n<ul>\n<li><strong>All-in-one:<\/strong> What do you want? - Email, SMS, push-notification? Get all-in-one.\n\n<ul>\n<li>But I don't want to use <code>xyz<\/code> provider for SMS, I want to use <code>pqr<\/code>, can I have that? Yes it provides you with lot of pre implemented providers for all email, sms and push-notification.<\/li>\n<\/ul><\/li>\n<li><strong>Super Scalable:<\/strong> But I want to use an email provider named <code>yxr<\/code> you haven't heard the name of. Now what? \ud83e\uddd0\n\n<ul>\n<li>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 <a href=\"https:\/\/github.com\/Souptik2001\/wp-messaging\/wiki\/Create-your-own-Adapter-%F0%9F%9B%A0%EF%B8%8F\">this<\/a> section for implementing adapters.<\/li>\n<\/ul><\/li>\n<\/ul>\n\n<p>And that's how it provides <strong>Limitless communication<\/strong>! \ud83d\ude80<\/p>\n\n<p>https:\/\/www.youtube.com\/watch?v=80hWdK8kREM<\/p>\n\n<h3>Quick Links<\/h3>\n\n<p><a href=\"https:\/\/github.com\/Souptik2001\/wp-messaging\/wiki\/Setup-%E2%9A%99%EF%B8%8F\">Setup \u2699\ufe0f<\/a> | <a href=\"https:\/\/github.com\/Souptik2001\/wp-messaging\/issues\">Issues<\/a> | <a href=\"https:\/\/github.com\/Souptik2001\/wp-messaging\/wiki\/Services-and-functions-%F0%9F%A7%A9\">Services and functions \ud83e\udde9<\/a> | <a href=\"https:\/\/github.com\/Souptik2001\/wp-messaging\/wiki\/Create-your-own-Adapter-%F0%9F%9B%A0%EF%B8%8F\">Create your own Adapter \ud83d\udee0\ufe0f<\/a><\/p>\n\n<h3>Coming soon \u23f3<\/h3>\n\n<ul>\n<li>Push notifications<\/li>\n<li>Email Testing page<\/li>\n<li>SMS Testing page<\/li>\n<li>Push notifications Testing page<\/li>\n<\/ul>\n\n<h3>Examples<\/h3>\n\n<h4>Email \ud83d\udce7\ud83d\udce8<\/h4>\n\n<p>Send an email through a particular adapter (with headers \ud83d\ude09) -<\/p>\n\n<pre><code>\\Souptik\\AllPathMessaging\\Email\\send(\n  [ 'dev2@souptik.dev' ],\n  'Yay its working!',\n  'This is some long mail body.',\n  'Souptik',\n  'dev1@souptik.dev',\n  [\n   'cc' =&gt; [\n    [\n     'name'  =&gt; 'CC Test',\n     'email' =&gt; 'cc@souptik.dev',\n    ],\n   ],\n   'attachments' =&gt; [\n    trailingslashit( WP_CONTENT_DIR ) . '\/mu-plugins\/test-all-path-messaging.php',\n     'SameFileDifferentName.php' =&gt; trailingslashit( WP_CONTENT_DIR ) . '\/mu-plugins\/test-all-path-messaging.php',\n   ],\n  ],\n  'mailgun'\n );\n<\/code><\/pre>\n\n<p>Just remove the last parameter! And now it uses the default selected adapter -<\/p>\n\n<pre><code>\\Souptik\\AllPathMessaging\\Email\\send(\n  [ 'dev2@souptik.dev' ],\n  'Yay its working!',\n  'This is some long mail body.',\n  'Souptik',\n  'dev1@souptik.dev',\n  [\n   'cc' =&gt; [\n    [\n     'name'  =&gt; 'CC Test',\n     'email' =&gt; 'cc@souptik.dev',\n    ],\n   ],\n   'attachments' =&gt; [\n    trailingslashit( WP_CONTENT_DIR ) . '\/mu-plugins\/test-all-path-messaging.php',\n     'SameFileDifferentName.php' =&gt; trailingslashit( WP_CONTENT_DIR ) . '\/mu-plugins\/test-all-path-messaging.php',\n   ],\n  ],\n );\n<\/code><\/pre>\n\n<p>Checked the override <code>wp_mail<\/code> checkbox? Try a simple <code>wp_mail<\/code>! -<\/p>\n\n<pre><code>wp_mail(\n  [ 'dev2@souptik.dev' ],\n  'Yay its working!',\n  'This is some long mail body - from &lt;strong&gt;wp_mail&lt;\/strong&gt;.',\n  [],\n  []\n );\n<\/code><\/pre>\n\n<h4>SMS \ud83d\udcf2<\/h4>\n\n<p>Send a SMS through a particular adapter -<\/p>\n\n<pre><code>\\Souptik\\AllPathMessaging\\SMS\\send( [ '+xxxxxxxxxxxx' ], 'Yay its working!', 'twilio' );\n<\/code><\/pre>\n\n<p>Just remove the last parameter! And now it uses the default selected adapter -<\/p>\n\n<pre><code>\\Souptik\\AllPathMessaging\\SMS\\send( [ '+xxxxxxxxxxxx' ], 'Yay its working!' );\n<\/code><\/pre>\n\n<h3>Creating your own adapter \ud83d\udee0\ufe0f<\/h3>\n\n<p>Here comes the cool part fellow developers! \ud83d\udcbb<\/p>\n\n<p><strong>Tip:<\/strong> I have provided a dummy adapter for each service at <code>inc\/&lt;service&gt;\/adapters\/dummy\/<\/code>.<\/p>\n\n<p>Consider that as the starting point and let's understand what each file does.<\/p>\n\n<ul>\n<li>Let's start with <code>namespace.php<\/code>. It is the entry point of your adapter.\n\n<ul>\n<li>In that you will see a simple <code>bootstrap<\/code> function.<\/li>\n<li>In that function we are hooking into <code>EMAIL_SLUG . '_adapters'<\/code> and registering our adapter.<\/li>\n<li>We pass the following data -<\/li>\n<li><code>slug<\/code><\/li>\n<li><code>name<\/code><\/li>\n<li><code>adapter<\/code> class object.<\/li>\n<li><code>options<\/code> - An array defining the settings required for this adapter, which will be used to automatically display the options on the settings page.<\/li>\n<\/ul><\/li>\n<li>Next is <code>class-adapter.php<\/code>, which is the Adapter class, which we initialized in the above file and passed it to <code>adapter<\/code>. It contains three simple functions -\n\n<ul>\n<li><code>get_settings_fields<\/code> - This is the function which returns the array of options, which we used in the above file for <code>options<\/code>. Each option, will have -<\/li>\n<li>The key as the name of the option.<\/li>\n<li>And three values -\n\n<ul>\n<li><code>label<\/code> - Label to display in the settings page beside the input.<\/li>\n<li><code>type<\/code> - Type of the field.<\/li>\n<li><code>sanitize_callback<\/code><\/li>\n<\/ul><\/li>\n<li><code>get_settings<\/code> - This function returns an associative array, whose keys are the name of the options and the value as the value of the options.<\/li>\n<li><code>get_adapter<\/code> - This function will just return the core provider class, which is responsible for processing the message.<\/li>\n<li>First check if <code>Utopia Messaging<\/code> already provides the provider or not <a href=\"https:\/\/github.com\/utopia-php\/messaging?tab=readme-ov-file#adapters\">here<\/a>, for example <code>Utopia\\Messaging\\Adapter\\Email\\Mailgun<\/code>.<\/li>\n<li>If it is present just use it. Easy peasy! \u2728<\/li>\n<li>But if not, let's code it ourself, because <code>Utopia Messaging<\/code> makes it so easy to create a new adapter!<\/li>\n<\/ul><\/li>\n<li><code>class-dummy.php<\/code> is for that purpose, assuming you don't get a provider already present in <code>Utopia Messaging<\/code>.\n\n<ul>\n<li>It's basically a child class of <code>EmailAdapter<\/code> or <code>SMSAdapter<\/code>, which abstract a lot of stuff for us!<\/li>\n<li>Let me explain two main functions, <code>_construct<\/code> and <code>process<\/code>. <em>Rest of the functions and properties are self-explanatory!<\/em> \ud83d\ude09<\/li>\n<li>In the <code>_construct<\/code> function just put the arguments which you want to accept. That's it! And now they will be available everywhere else as <code>$this-&gt;param_name<\/code>!<\/li>\n<li>The <code>process<\/code> function is the place where you have to write the main logic of calling your providers API to send the message.\n\n<ul>\n<li>As said above all the credentials\/data you accepted through constructor are available as <code>$this-&gt;param_name<\/code>.<\/li>\n<li>Build the <code>body<\/code> and the <code>headers<\/code>.<\/li>\n<li>And then you can use the <code>$this-&gt;request<\/code> function as demonstrated in the dummy!<\/li>\n<li>Create a response using Utopia's <code>Response<\/code> class.<\/li>\n<li>Handle the errors, populate the response, return! Done! \ud83d\ude80<\/li>\n<\/ul><\/li>\n<\/ul><\/li>\n<\/ul>\n\n<h3>External services<\/h3>\n\n<h4>Brevo<\/h4>\n\n<p>This plugin connect's to Brevo's API to send emails through Brevo. This is the <a href=\"https:\/\/api.brevo.com\/v3\/smtp\/email\">API<\/a> it sends the request to.\nThe 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).\nHere is the <a href=\"https:\/\/www.brevo.com\/legal\/termsofuse\/\">Terms of Use<\/a> and <a href=\"https:\/\/www.brevo.com\/legal\/privacypolicy\/\">Privacy Policy<\/a> of the service.<\/p>\n\n<h4>AWS SES<\/h4>\n\n<p>This plugin connect's to AWS SES's API to send emails through AWS SES.\nThe 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).\nHere is the <a href=\"https:\/\/aws.amazon.com\/service-terms\/\">Terms of Use<\/a> and <a href=\"https:\/\/docs.aws.amazon.com\/ses\/latest\/dg\/data-protection.html\">Privacy Policy<\/a> of the service.<\/p>\n\n<h4>Mailgun<\/h4>\n\n<p>This plugin connect's to Mailgun's API to send emails through Mailgun.\nThe 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).\nHere is the <a href=\"https:\/\/www.mailgun.com\/legal\/terms\/\">Terms of Use<\/a> and <a href=\"https:\/\/www.mailgun.com\/legal\/privacy-policy\/\">Privacy Policy<\/a> of the service.<\/p>\n\n<h4>Telesign<\/h4>\n\n<p>This plugin connect's to Telesign's API to send SMS through Telesign.\nThe request is send everytime the function to send SMS is invoked with the Adapter as Telesign or the default adapter is set as Telesign.\nHere is the <a href=\"\/\/www.telesign.com\/telesign-terms-of-service\">Terms of Use<\/a> and <a href=\"https:\/\/www.telesign.com\/privacy-policy\">Privacy Policy<\/a> of the service.<\/p>\n\n<h4>Twilio<\/h4>\n\n<p>This plugin connect's to Twilio's API to send SMS through Twilio.\nThe request is send everytime the function to send SMS is invoked with the Adapter as Twilio or the default adapter is set as Twilio.\nHere is the <a href=\"https:\/\/www.twilio.com\/en-us\/legal\/tos\">Terms of Use<\/a> and <a href=\"https:\/\/www.twilio.com\/en-us\/legal\/privacy\">Privacy Policy<\/a> of the service.<\/p>\n\n<!--section=installation-->\n<p>Upload 'all-path-messaging' to the '\/wp-content\/plugins\/' directory.<\/p>\n\n<p>Activate the plugin through the 'Plugins' menu in WordPress.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt id='i%20have%20a%20codebase%2C%20where%20i%20have%20used%20%60wp_mail%60.%20do%20i%20need%20to%20make%20any%20changes%20to%20the%20codebase%20after%20installing%20this%20plugin%3F'><h3>I have a codebase, where I have used `wp_mail`. Do I need to make any changes to the codebase after installing this plugin?<\/h3><\/dt>\n<dd><p>Good news - no!\nYou just have to check the <code>Override wp_mail functionality checkbox<\/code> in the settings and that's it! All your mails you are triggering through <code>wp_mail<\/code> will be sent through your selected provider!<\/p><\/dd>\n<dt id='i%20am%20already%20using%20an%20email%20marketing%20plugin.%20can%20i%20use%20this%20plugin%20to%20use%20as%20the%20email%20sending%20service%3F'><h3>I am already using an email marketing plugin. Can I use this plugin to use as the email sending service?<\/h3><\/dt>\n<dd><p>Absolutely!\nThe 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 <code>wp_mail<\/code>). And that's it the emails will be send through the desired provider you select in this plugin.<\/p><\/dd>\n<dt id='i%20need%20a%20provider%20called%20%60xyz%60%2C%20which%20is%20not%20present%20currently%20in%20this%20plugin.%20do%20i%20have%20to%20ask%20you%20to%20integrate%20that%3F'><h3>I need a provider called `xyz`, which is not present currently in this plugin. Do I have to ask you to integrate that?<\/h3><\/dt>\n<dd><p>If you know coding! - You don't have to wait for it! <a href=\"https:\/\/github.com\/Souptik2001\/wp-messaging\/wiki\/Create-your-own-Adapter-%F0%9F%9B%A0%EF%B8%8F\">Go ahead and create your own adapter in your plugin by extending this plugin.<\/a>\nIf you are non-tech! - Please create an <a href=\"https:\/\/github.com\/Souptik2001\/wp-messaging\/issues\">issue<\/a> over here, and I will try to integrate the provider ASAP.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>First stable release.<\/li>\n<\/ul>","raw_excerpt":"Limitless Communication: All-in-one, super scalable, messaging Solution for WordPress.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/208981","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=208981"}],"author":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/souptik"}],"wp:attachment":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=208981"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=208981"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=208981"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=208981"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=208981"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=208981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}