The Rules module together with Rules Scheduler
(a sub-module of it), can be used for sending such eMails, as explained in the steps below.
Step 1: Create a field to store the "next renewal" date
Add a field to the "user" entity with machine name (say) field_next_renewal
. Allow only 1 date (to store the "next" renewal date).
Step 2: Create a Rules "Component"
Here is the Rules Component to be created (in Rules export format, just import it in your own environment via copy-paste):
{ "rules_send_email_notification" : {
"LABEL" : "Send eMail notification",
"PLUGIN" : "action set",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"USES VARIABLES" : { "user_to_notify" : { "label" : "User to be notified", "type" : "user" } },
"ACTION SET" : [
{ "mail" : {
"to" : [ "user-to-notify:mail" ],
"subject" : "Reminder about your next renewal",
"message" : "This is a reminder about your next renewal on [user-to-notify:field_next_renewal] ...",
"from" : "[site:mail]",
"language" : [ "" ]
}
}
]
}
}
Obviously, the Subject and Content of the eMail may need review / tuning, while you might also want to use some other From eMail ID.
Step 3: Create a "Rule" using the Rules Component
Here is the Rule to be created, in Rules export format (just import it in your own environment via copy-paste):
{ "rules_email_user_every_6_months" : {
"LABEL" : "eMail user every 6 months",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules", "rules_scheduler" ],
"ON" : { "user_insert" : [] },
"IF" : [
{ "entity_has_field" : { "entity" : [ "account" ], "field" : "field_next_renewal" } }
],
"DO" : [
{ "data_set" : { "data" : [ "account:field-next-renewal" ], "value" : "+6 month" } },
{ "schedule" : {
"component" : "rules_send_email_notification",
"date" : {
"select" : "account:field-next-renewal",
"date_offset" : { "value" : 15552000 }
},
"identifier" : "[account:name]",
"param_user_to_notify" : [ "account" ]
}
}
]
}
}
The above rule refers to the Rules Component from the previous step.
Note that the 15552000
is the equivalent of 6 months in seconds. You may want to reduce that a bit, e.g. with a number of seconds equivalent to a few days (or a week or so). That way the eMail will be triggered a few days before the actual renewal.