{"id":143276,"date":"2021-06-30T04:40:05","date_gmt":"2021-06-30T04:40:05","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/tukutoi-send-email-if\/"},"modified":"2021-06-30T05:09:51","modified_gmt":"2021-06-30T05:09:51","slug":"tkt-send-email-if","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/tkt-send-email-if\/","author":14808221,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.0","stable_tag":"1.0.0","tested":"5.7.15","requires":"4.9","requires_php":"","requires_plugins":"","header_name":"TukuToi Send Email If","header_author":"TukuToi","header_description":"Send Email If Plugin allows you to send an email to a dynamically set receiver, whenever a Post is visited by users of defined roles.","assets_banners_color":"","last_updated":"2021-06-30 05:09:51","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.tukutoi.com\/","header_plugin_uri":"https:\/\/www.tukutoi.com\/program\/send-email-if\/","header_author_uri":"https:\/\/www.tukutoi.com\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":829,"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":"bedas","date":"2021-06-30 05:09:51"}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":2556155,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":2556155,"resolution":"256x256","location":"assets","locale":""},"icon.svg":{"filename":"icon.svg","revision":2556155,"resolution":false,"location":"assets","locale":false}},"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":2556155,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":2556155,"resolution":"2","location":"assets","locale":""}},"screenshots":{"1":"The Email MetaBox in the Post Edit Screen.","2":"The Email as received (raw text, HTML will be expanded in real live case)."}},"plugin_section":[],"plugin_tags":[165197,267,38159,1937,46467],"plugin_category":[41],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-143276","plugin","type-plugin","status-closed","hentry","plugin_tags-classicpress","plugin_tags-email","plugin_tags-talent","plugin_tags-view","plugin_tags-visitor-notification","plugin_category-communication"],"banners":[],"icons":{"svg":"https:\/\/ps.w.org\/tkt-send-email-if\/assets\/icon.svg?rev=2556155","icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/tkt-send-email-if.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/tkt-send-email-if\/assets\/screenshot-1.png?rev=2556155","caption":"The Email MetaBox in the Post Edit Screen."},{"src":"https:\/\/ps.w.org\/tkt-send-email-if\/assets\/screenshot-2.png?rev=2556155","caption":"The Email as received (raw text, HTML will be expanded in real live case)."}],"raw_content":"<!--section=description-->\n<p>Sometimes, you need to know when certain posts are being viewed\/visited\/discovered by users, be it guests or logged in users.\nFor example, in a Talent Discovery Directory you might want to inform the Talent or Talent Manager that someone is vieweing their Talent Profile right now. You might want to do that discretly, but reliably, without bloating the website with heavy (and Privacy problematic) user tracking.<\/p>\n\n<p>This plugin has a solution to that problem.\nIt allows you to easily send an email to a given receiver, whenever a certain post is visited. \nYou can set a specific receiver for each post. \nYou can control on what posts the receiver should be set, and thus the email sent when the post is visited.\nYou can control what user Roles will trigger the notification when they visit the post.\nYou can also customize the email contents as well as other aspects of the email.<\/p>\n\n<p>The entire plugin is very lightweight and thus renounces to any Backend Settings Screens. \nIt only adds a tiny Metabox to your posts (of choice) to save the receiver email.\nThe rest of the Plugin functionality is controlled with a set of Filters.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Install and Activate like any other Plugin in WordPress.<\/li>\n<li>Head to the Plugin Settings Screen in the WordPress Dashboard &gt; TukuToi &gt; Send Email If. There you can control the Plugin settings such as determine which posts should trigger an email, and what action should send the email, and customize the email sent.<\/li>\n<li>Control the plugin settings with the provided Filters (see FAQ)<\/li>\n<li>Save the email for each specific post where you want an email being sent.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='this%20plugin%20has%20no%20settings%21'><h3>This Plugin has no settings!<\/h3><\/dt>\n<dd><p>That's right, in order to keep this lightweight, no settings or options pages where added in the backend.\nInstead, a set of Filters will allow you to control the Plugin behaviour fully.\nRead more about this in the below FAQ entries.<\/p><\/dd>\n<dt id='this%20plugin%20does%20not%20work%20after%20activating%21'><h3>This Plugin does not work after activating!<\/h3><\/dt>\n<dd><p>The plugin will not activate its features unless you tell it to do so, using the Filters documented below.\nMandatory filters you must use are <code>tkt_sei_metabox_location<\/code> and <code>tkt_sei_notify_on_role_visit<\/code>. \nRead more in the below FAQs.<\/p><\/dd>\n<dt id='how%20to%20modify%20the%20email%20%22about%22%3F'><h3>How to modify the email \"About\"?<\/h3><\/dt>\n<dd><p>You can use the filter <code>tkt_sei_email_subject<\/code> in order to customize the \"About\" of the Email sent.\nYou just need to return a valid Email \"About\" (string) in the callback function:<\/p>\n\n<pre><code>add_filter('tkt_sei_email_subject', 'my_custom_email_subject');\nfunction my_custom_email_subject(){\n\n    $subject ='My Custom About';\n\n    return $subject;\n\n}\n<\/code><\/pre><\/dd>\n<dt id='how%20to%20modify%20the%20email%20%22body%22%3F'><h3>How to modify the email \"Body\"?<\/h3><\/dt>\n<dd><p>You can use the filter <code>tkt_sei_notification_content<\/code> in order to customize the \"Body\" of the Email sent.\nYou just need to return a valid Email \"Body\" (string or html with inline CSS) in the callback function:\nThe Filter passes 3 additional arguments for your convenience.<\/p>\n\n<pre><code>add_filter('tkt_sei_notification_content', 'my_custom_notification_content', 10, 4);\nfunction my_custom_notification_content($default_message, $post, $current_user, $receiver_email){\n\n    \/\/$post is the Post Object of the post which was visited.\n    \/\/$current_user is the User Object of the user who visited the post. Might be empty, if guest user.\n    \/\/$receiver_email is the email stored to the post visited (the email that will get the notification).\n\n    $default_message = 'My new Custom Notification Content with &lt;strong&gt;valid HTML&lt;\/strong&gt;';\n\n    return $default_message;\n\n}\n<\/code><\/pre><\/dd>\n<dt id='how%20to%20modify%20the%20email%20%22to%22%20%28receiver%29%3F'><h3>How to modify the email \"To\" (Receiver)?<\/h3><\/dt>\n<dd><p>You can use the filter <code>tkt_sei_receiver_email<\/code> in order to customize the \"To\" (Receiver) of the Email sent.\nYou just need to return a valid Email address in the callback function:<\/p>\n\n<pre><code>add_filter('tkt_sei_receiver_email', 'my_custom_receiver_email');\nfunction my_custom_receiver_email(){\n\n    $email = 'custom@receiver.com';\n\n    return $email;\n\n}\n<\/code><\/pre><\/dd>\n<dt id='how%20can%20i%20control%20where%20the%20metabox%20appears%2C%20and%20which%20posts%20should%20be%20observed%2Ftriggering%20the%20email%3F'><h3>How can I control where the Metabox appears, and which posts should be observed\/triggering the email?<\/h3><\/dt>\n<dd><p>You can use the filter <code>tkt_sei_metabox_location<\/code> in order to customize the \"Location\" where the metabox will appear.\nIn other words, with this filter you can decide on what Post Types you will want the plugin functionality active.\nYou just need to return an array of valid Post Types in the callback function:<\/p>\n\n<pre><code>add_filter('tkt_sei_metabox_location', 'my_custom_metabox_location');\nfunction my_custom_metabox_location(){\n\n    $posts = array('post', 'page');\/\/Array of post Types where the functionality shoud be active.\n\n    return $posts;\n\n}\n<\/code><\/pre><\/dd>\n<dt id='how%20can%20%20i%20control%20what%20users%20%28visitors%29%20trigger%20the%20email%3F'><h3>How can  I control what users (visitors) trigger the email?<\/h3><\/dt>\n<dd><p>You can use the filter <code>tkt_sei_notify_on_role_visit<\/code> in order to customize the \"Visitor\" Role that should trigger the email.\nIn other words, this allows you to determine what User Roles will actually trigger the emails, when an user of such role visits a post which is observed.\nThe filter expects an array of valid User Roles.\nPass 0 (int) if you want guests to trigger emails.\nEmpty array (default) triggers no email at all.<\/p>\n\n<pre><code>add_filter('tkt_sei_notify_on_role_visit', 'my_custom_notify_on_role_visit');\nfunction my_custom_notify_on_role_visit(){\n\n    $role = array( 'administrator', 0, 'subscriber' );\/\/ it sends the email if a user with role administrator, or subscriber, or even a guest is visiting.\n\n    return $role;\n\n}\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial Commit.<\/li>\n<\/ul>","raw_excerpt":"TukuToi Send Email If Plugin allows you to send an email to a dynamically set receiver, whenever any Post of a dynamically set type is visited by user &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/143276","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=143276"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/anonymized-14808221"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=143276"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=143276"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=143276"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=143276"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=143276"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=143276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}