Hello everyone,

I'm calling node_save() from a custom module.
I also created a rule which is triggered once a new content is added. It should unpublish the node, redirect the users and send an email.

Only redirection works properly. The node is not unpublished and the user does not receive an email.
The itself node is saved properly and there are no error messages in the log.

Any ideas where the problem might be?

Thanks!

Comments

bisonbleu’s picture

Component: Rules Core » Rules Engine

I have a similar problem.

A simple rule that sends an email when a node is created (no custom module):

- IF Created content is [my-content-type]
- DO Send a mail to an arbitrary mail address

I've tried using the following tokens:

- [node:field_email-formated]:
-- generates an error
-- Log entry: Error sending e-mail (from Webmaster to firstname.lastname@mydomain.com).

- [node:field_email-raw]:
-- generates a Successful message
-- Log entry: Successfully sent email to firstname.lastname@mydomain.com
-- But NO email is ever received!

I tested sending an email with the user Contact tab. It works as expected.

Can anyone help or make a suggestion?

bisonbleu’s picture

Title: Send email to an arbitrary address not triggered on node_save() called from custom module » 'Send a mail to an arbitrary mail address' action does not work

Changing the title to reflect what appears to be a more generic issue (unrelated to custom module).

bisonbleu’s picture

Priority: Major » Normal

Update.

Change Rules settings from After saving new content to Content is going to be saved and it will work.
It does not make complete sense to me.
But hey, it works! :-)

tr’s picture

Component: Rules Engine » Rules Core
Issue summary: View changes
Status: Active » Closed (outdated)