All about Email Reminder

I was exploring Sitecore’s “Email Reminder” functionality today and thought it’d be better to turn it into a Blog post with more detail. It might come useful to someone :).

Sitecore is a powerful tool for managing your digital content. If you learn how to use a Sitecore solution to its maximum potential, you will likely discover many more ways to streamline your work and make your job easier.

Email Reminder is one of the ways to streamline users work. In this blog post, I will cover the following topics,

  • Why we need it?
  • How to set it up?
  • Where it will be stored in the Database?
  • How to Configure and Customize it?
  • How to disable it?

 

Why we need it:

In Sitecore, you can schedule to send out an email reminder to one or more users.

This feature is particularly useful if you have time-sensitive content on your website. For example, if your website contains a special offer that runs out on a certain date, you can use the reminder to send yourself or others a reminder to remove the offer from the website on the appropriate day. 

 

How to set it up:

  • Go to “Content Editor” and select “Review” Tab
  • Click on “Reminder”  and choose “Set Reminder”
  • Enter the message, date, time and email addresses
  • Click “Set”

That’s it, the reminders will be sent to the recipients on the date and time you specified.

You can find more details in the below Sitecore Documentation page,

https://doc.sitecore.com/users/91/sitecore-experience-platform/en/set-up-an-email-reminder.html

Reminder

 

Note:

You can only configure one reminder for each item. If you already have one reminder set for an item, and want to set another reminder, you have to overwrite the earlier reminder.

 

Where it will be stored in the Database:

The “Sitecore.Tasks.ItemEventHandler” class creates an instance of the type (Sitecore.Tasks.EmailReminderTask) and writes the values to the “Tasks” table in the “Core” DB.

Reminder-DB

 Note:

ArchiveItem and ArchiveVersion tasks are also created in the Task table.

 

How to Configure and Customize it:

The settings for Email Remainder is already available in Sitecore.config. In the config file, you will find an agent called – TaskDatabaseAgent, which process the tasks.

The scheduled database agents check for pending tasks from time to time and instantiate the defined task type and send the emails.

Reminder-Config1

In the EmailReminderTask class, the email subject and body are retrieved from the below setting.

Reminder-Config2

You could patch them in a custom config file with your own values.

You can also customize the above functionality by extending the TaskDatabaseAgent class. Below is the code from “Sitecore.Tasks.EmailReminderTask” class “SendReminder” method for your reference.

Reminder-Customization

 

How to disable it:

We can disable the Email Reminder on the following ways,

  • Using Sitecore Content Editor 

To clear the reminder that you have configured for an item, on the Review tab, in the Schedule group, click Reminder, and then click “Clear Reminder“.

  • Updating tasks table of Core Database

You can disable EmailReminderTask for multiple items by updating tasks table of Core database.

Update [Tasks] set Disabled=1 where taskType=’Sitecore.Tasks.EmailReminderTask,Sitecore.Kernel’

 

Note: 

But Reminder Notification will be  still shown on the item as shown in the image below, you have to clear it by updating item fields (ReminderText, ReminderRecipients, and ReminderDate) value to empty.

Reminder Notification

  • Disabling TaskDatabaseAgent in the web.config

You can suspend EmailReminderTask by setting TaskDatabaseAgent interval value to 00:00:00

<agent type=”Sitecore.Tasks.TaskDatabaseAgent” method=”Run” interval=”00:00:00″ />

Note:

Disabling TaskDatabaseAgent will also suspend execution of other pending tasks like ArchiveItem or ArchiveVersion.

  • Using Custom Code 

You can write your own function to clear Email Reminder.

 

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s