It would be nice if email sending could be inserted in actions for rules. What do you think?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webwriter’s picture

I'd love to be able to set a rule to automatically print the day's event list for the front desk every morning. +1 for rules integration!!

jcnventura’s picture

Status: Active » Postponed
pluess’s picture

Assigned: Unassigned » pluess
Status: Postponed » Active

We just started to implement this feature. What would be the best way to do this. Currently we set up a new module which requires the print module. Is there a better way?

shadow_jh’s picture

I desperately need rules integration. Is there a patch available that I can try?

Essentially I just need the ability to send a specific node to a users account email (or any system variable) defined in the rule. Should be a pretty simple integration.

pluess’s picture

FileSize
5.7 KB
233 bytes

This is my code. Did not have the time to create a modul on drupal.org.

mike.y’s picture

It might be better just to add your patch as a seperate file (such as print.rules.inc) and add an if statement to include the file if the rules module is present.

Gealion’s picture

Cheers for the patch. Unfortunatly I need it to print PDF instead of sending a mail. If I was good enough at coding I would have modify your code.. but I'm a noob in Drupal dev.
If you have some time, could you do this
Cheers a lot

shadow_jh’s picture

The patch worked great in drupal 6. My latest project is for drupal 7. Does anyone know know to convert this patch for rules 2 in drupal 7?

shadow_jh’s picture

I can sponsor this work if anyone is available to complete the task. Drupal 7 rules integration, the above patch ported to 7 or a new module.... post a price and lets get this thing moving.

iamnayr’s picture

Subscribing. Definitely need this functionality.

shadow_jh’s picture

Im not getting any traction here so I've posted in the services section hoping some one will take on the challenge:
http://drupal.org/node/1080406

jcnventura’s picture

Status: Active » Needs review
pluess’s picture

FileSize
4.91 KB
333 bytes

This is a first draft for a D7 version.

I simply changed the things to get it working in D7, but I think it can be improved a lot. The type definition leads to show textareas instead of textfields on the configuration screen. I'm not sure whether I have to adjust this by altering the form or using an other type in the action definition. Further more I didn't find any documentation about how to get a select box in the configuration, so this part is missing as well. I'm waiting for answer to this question here: http://drupal.org/node/1081506.

I have to have a closer look into the changes of the API of the print module. I think this part could be simplified as well. Currently it contains a lot of D6 code which was simply copied from the print module and adjusted to needs of the action.

Any comments are very welcome.

iamnayr’s picture

Couldn't find a viable solution so I paid someone on Elance to do it.

I haven't tried the patch from pluess, but the module I paid to have developed is working perfectly on our site.

I'll do a bit more testing but will likely post it here later, maybe it can be committed.

pluess’s picture

Just post your module as it is now. This way we can learn from each other an find the best solution. That's how the community works.

pluess’s picture

FileSize
1.64 KB
333 bytes

This version is fully working now for D7.

Hav fun Ernst

pluess’s picture

Version: 6.x-1.9 » 7.x-1.x-dev

How should I proceed with this? Create a new module or provide a clean patch in order it can be added to the print module?

jcnventura’s picture

Version: 7.x-1.x-dev » 6.x-1.9

I'm taking a look at it.

I'm trying to close any open points in the queue for 6.x, then I'll align the 7.x version with that and fix any D7-specific bugs before the 7.x-1.0 release.

I'd think this can be useful as part of the module, but if you want to make your own module, that's your choice.

UK_Rogue’s picture

The D6 additional module works well but doesn't include the sending of attached views fields as per the original module.
I'm going to do a comparison between the two codes to see if I can identify it but if anyone could point me in the right direction quicker it would be greatly appreciated. Currently I'm looking only at emailing a full node with a view attached via node content.

Thanks

pluess’s picture

After all: I think back-porting the D7 version would give you all the original features. My Version for D6 works but does to much by itself. Everything which I did not copy from the original D6 code is not included.

UK_Rogue’s picture

Sorry pluess but didn't quite understand the last post: 'Everything which I did not copy from the original D6 code is not included' I must have brain ache!

Thanks

pluess’s picture

I coded the D6 version by copying a lot of code from the module and changing it to my needs. This means I deleted some features I didn't need or did not understand. That's why they are not available.

The D7 version works completely different. It calls the method which normally handles the user input. This means the print module thinks you entered all the data in the appropriate form. This way all original features and settings are available and no code is duplicated.

To get your missing feature working, it would be much easier to port the D7 code back to D6 instead of recoding the missing feature in my current D6 code.

jcnventura’s picture

Status: Needs review » Fixed

Indeed, the D6 version was a lot better when using the same code as the D7 version used.

This rule is now a part of the module (both D6 and D7).. Thanks for the patch, pluess!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

rfulcher’s picture

I have put the new release into my site and can't see any rules integration. Am I missing a setting somewhere?