0

I have created a rule to trigger an email in user profile. But I could see the email after running cron only or else I could not see email in my inbox. Why is this? Can any one help in this please? I want to send an email automatically on particular date even though if I don't run the cron.

Can anyone help me? You will be appreciated.

  • I think the link gives you the solution drupal.org/node/370328#comment-1818304 – Vamsi Sep 9 '15 at 5:33
  • @vamsi: thanks i am looking for the solution from long time, i will try with link which u suggested. – kashish Sep 9 '15 at 5:38
  • @vamsi: they are creating trigger action for cck bt in my case for the whenever we save the user account. – kashish Sep 9 '15 at 6:34
  • When you save the new content you need to send the mail. Am I right – Vamsi Sep 9 '15 at 6:38
  • i have date field in user profile whenever user account created after 1 month orientation mail need to send on that day, for this i created component and used that component in rules, but i am able to send the mail only if i run the cron, but i want to send mail automatically on that day because user cannot run each and every time.please help me if you know how to achieve this – kashish Sep 9 '15 at 6:57
0

Ultimate Cron

will do the job. I think it is not possible with default drupal-cron bicause as far as I know, it will be fired on page request.

  • can u please explain with bit clarity i am not getting what exactly need to do, m sorry to ask, but m newbie to drupal please bear me. – kashish Sep 9 '15 at 7:10
  • with Ultimate Cron you will be able to define real cronjob that will be fired on time defined by cron rules. Install Ultimate Cron, define firing rules. Your goal is to fire cron on given time? – Paul Bönisch Sep 9 '15 at 7:14
  • will it be able to send the mail automatically though i dont run the cron, because my concern is i may skip to visit the drupal site,if i dont visit also will it trigger a mail which i have created rule. – kashish Sep 9 '15 at 7:19
  • exactly. "Ultimate cron" provides this functionality – Paul Bönisch Sep 9 '15 at 7:25
0
  1. All the things you schedule for a particular time are executed with help of cron

How does drupal cron works.

  • You can run it manually, which of course you don't need.
  • If your site is being accessed by any user, cron will run and will pick all scheduled task pending/active.
  • Someone else can run it for you, in that case you need crontab setup on your server if linux is the operating system

Drupal Modules

  • Elysia Cron, Ultimate cron will help you make your cron task more granular, so you can decide what task to run at what time.
  • arpit: thanks,but is no other way to send mail automatically ??though we dont run the cron...... – kashish Sep 9 '15 at 7:24
  • setup crontab on server then you will not need to run cron manually. Or use third party tools like mailchimp which is paid service and you will need to integrate it with drupal. I see crontab as good option. Any reason you are reluctant about cron? – arpitr Sep 9 '15 at 7:28
0

you can do using these module :

Rules

  • Obviously, you may use reaction rules to react upon any event with custom conditions and actions.
  • Allows functionality to be re-used via components (Drupal 6: Rule sets only).
  • Flexible scheduling system that allows scheduling any component / action.
  • Users can share their customizations by using the built-in import/export feature. For that the module also integrates with
    Features.
  • Modular input evaluation system - for example you can install the Token module and use it in every action.
  • The module has been developed with site performance in mind, so it makes use of caching routines to speed up rule evaluation.

Scheduler

This module allows nodes to be published and unpublished on specified dates.

Dates can be entered either as plain text or with calendar popups. To use calendar popups you need to install the Date Popup module, which is part of the Date module.

introducing-rules-scheduler

  • Rules Scheduler needs components – you can only schedule prepared components
  • Components can be scheduled as actions, for example from reaction rules
  • The evaluation time for scheduled tasks is set with strtotime(), which means that you can use highly flexible expressions
  • You can also use data selection, combined with offsets if you want to
  • Every scheduled task should have a unique task ID, or it will replace existing tasks
  • Scheduled tasks are displayed under the Schedule tab on the Rules admin pages
  • You can delete tasks manually if you want to
  • You can schedule tasks manually, without the need of reaction rules
  • It is sometimes useful to execute rule components manually, to see that the scheduled tasks will work as expected

Method 2 :

Create a Rule send email after 2 weeks of user registration (you can set it according to your requirement its just idea only for help)

In Rules,

  • Add a new component under the Components tab. The component plugin is "Action set". Call it "Send email to User". Under settings, add a variable "User", label "User", machine name "user", usage "parameter". Save component.
  • Add an action, "Send mail" under "System". Fill out the form accordingly. Save the component.
  • Add a new rule, under the Rules tab. Call it "Send email to new user". Add an event:" After saving a new user account". Add an action "Schedule component evaluation". In the form, select the component "Send email to User". Specify your scheduled date, like "+2 weeks", which means 2 weeks from creation of new user. Add an identifier (this is useful as a pointer when you create the rule to delete the scheduled email when the user logs in before the 2 weeks.) Something like, "send email to new user [account:uid]" where [account:uid] makes this identifier unique. Under User, write "account" as the Data selector. This will pass in the user info to the component.

This will send the email after 2 weeks of user creation. Now, you have to create a rule to delete the schedule when the user logs in before 2 weeks.

  • add a new rule, "Delete new user reminder". Add event: "User has logged in". Add action: "Delete scheduled task". Under component, select "Send email to User". Under identifier, copy and paste the identifier from the scheduled rule, "send email to new user [account:uid]". Save.
  • Set the weight to -1. Or set it to run before the email is sent. I can't recall why this is important. Look at the post above.
  • Adi:Thanks for your effort: i will try and get back to you soon – kashish Sep 9 '15 at 7:30
  • Adi:after setting rule i have set mail after 6 month it has to send mail, i dont want to delete because every 6 month once the mail should send to user for renewal. say twice in a year and goes on....... – kashish Sep 9 '15 at 8:14
  • you can skip delete portion – Adi Sep 9 '15 at 9:02
  • groups.drupal.org/node/62048 here in this link they are specifying delete part will make sure that any scheduled reminders are deleted when the user logs in, and then a new reminder is scheduled 7 days from the log-in date. ??so m confused......in my case do i need to create or skip the delete part?? – kashish Sep 9 '15 at 9:17

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.