3

In my user profile there is date of orientation(date field) from date(current date) and end date.

When user fills the date field, it should generate an Mail for every X months. example-according to screen shots i have two date field when user have given from date(current date or future date)based on that date for both date fields should trigger a mail every X months.

enter image description here

enter image description here

  • "When user fills the date field, it should generate an Mail for every two months." two months from which date? from date? or end date? – No Sssweat Sep 14 '15 at 11:05
  • @ NoSssweat - thanks for your response,based on from date(from date is current date) – DINE Sep 16 '15 at 8:13
  • how did u add the from & to date fields? did u install a special module to do that? or are they two seperate fields with separate machine names? – No Sssweat Sep 17 '15 at 11:22
  • @ NoSsweat - it is two seperate date fields,when i have fill from date automatically end will be generate. – DINE Sep 17 '15 at 11:30
  • @DINE Please don't add random images to your posts - if the images you recently added somehow enhance your question, you need to let people know what that is. They just look like random image dumps of your browser console window, which obviously won't relate to sending an email via rules – Clive Sep 30 '15 at 11:31
3

Requirements:

Rules, Rules UI and Rules Scheduler must be installed and enabled.

Step 1) Create a new component, I named it send mail every 2 months

enter image description here

Step 2) Add an action of Send Mail, fill out the form, see picture below.

enter image description here

Step 3) Add an action (again)

This time select Schedule Component Evaluation and select your component (send mail every 2 months)

enter image description here

Note: this will re-schedule your e-mail to be sent 2 months after its sent for the 1st time

Step 4) For SCHEDULED VALIDATION DATE, erase everything and put +2 Months

For Identifier, put something like I did (see picture) so you know who the schedule is for.

For ACCOUNT, put account

enter image description here Step 5) Create a new rule, for React on Event, select After saving a user account.

Step 6) Add an action, select Schedule Component Evaluation and select your component (send mail every 2 months)

Step 7) Click on the switch to data selection button

enter image description here

Step 8) Put your field in Scheduled Evaluation Date. My user date field is called From Date with a machine name of field_from_date Therefore, it's account:field-from-date

Click on Add Offset, put 2 and select Months. (This means it will send the e-mail 2 months from the from date.

For Identifier, put something like I did (see picture) so you know who the schedule is for.

ACCOUNT, put account

enter image description here

  • Comments are not for extended discussion; this conversation has been moved to chat. – Clive Sep 30 '15 at 11:02
  • 1
    Please don't vandalise your posts, regardless of whether you think it's received enough votes; that's not something you get to decide - either provide the answer with good nature and intention, or don't provide it at all. Thanks – Clive Sep 30 '15 at 11:03
  • @DINE click here to chat – No Sssweat Sep 30 '15 at 11:16
1

Refer to my answer to the question about "Rule to store user's last post date and scheduled rule based 30 day reminder", which is a variation (though not a duplicate) of your question here. Below are some more details about the steps you need to complete to make it work for your case also.

Step 1

Your to date already corresponds to field_next_article. Let's assume the fieldname of your to date is field_to_date.

Step 2

Copy the Rules component example from Step 2 (in export format already) to some temporary file, and perform these changes:

  • change field name field_next_article to field_to_date.
  • change the eMail details (such as Subject, etc) to fit your requirements.

Then import the edited version in your own site.

Step 3

Copy the Rules example from Step 3 (in export format already) to some temporary file, and perform these changes:

  • change field name field_next_article to field_to_date.
  • change 30 days to 2 months, and review (correct) the value for date_offset (to also make it match 2 months).
  • Replace the "Rules Event" (= the line starting with "ON", by "some event that fits your exact requirements".

Then import the edited version in your own site.

Step 4

To actually sent such eMail every 2 months, you need to add another action at the end of the Rules component you created in Step 2. That action is to repeat the execution of the Rules component itself (which was created in Step 2), similar to what is explained in the video about "Repeating scheduled events" (especially what is shown from about 7:00 to 8:00 in that video).

Note: If you're not familiar (enough/yet) with Rules, checkout the 32 (!!!) great, and free, video tutorials Learn the Rules framework.

PS: I'm assuming this question is about D7.

  • Comments are not for extended discussion; this conversation has been moved to chat. – Clive Sep 17 '15 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.