Hi,

Since the site requires that a particular role send out the messages, but not give permission to that role to edit the template, can we change something in the code to skip the preview section and directly come to the page with the Send Email button?

Thank you so much for this wonderful module!
Jaya

Comments

dwightaspinwall’s picture

Category: support » feature

Just to be clear, PET provides the ability to modify an email without changing the template. Are you suggesting that users with "administer previewable email templates" should be able to specify that a given PET is not modifiable at all; that it must be sent as is or not at all?

Can you justify the use case to me? I'm prepared to believe that there is one; just curious.

j4’s picture

Hi, Sorry If I am sounding dumb! the scenario is that the "Site Manager" should be able to send some specific mails to individual users of the site for various reasons. The specific mails need to prepopulate as well as the user's email id, all by the click of a button.
While the mass contact module allows us to create separate sets of users, while the contact form on the site allows us to create different contact forms for different purposes to contact the site admin, I found your module very useful for this purpose of mine, where I have written some php code to make lists of users in the different roles for the "Site Manager" to see, and by just clicking on their name he goes to /pet/pet_name/uid?=specific_uid, which is exactly what my client wanted. But to go that one step further and ensure that it gets sent automatically without having to preview...Am I using the wrong module? Or approaching it the wrong way? If yes, could you please show me the right direction?

I would also like to mention that I need this direct send facility only for one role while the admin retains the preview template mode. If we could have the preview template and send email on the same page like how we have it in nodes, it would make it one page load lesser?

Thank you for the immediate response!
Jaya

dwightaspinwall’s picture

Sorry to be late getting back to you.

To do this you'd need to write a menu callback that takes a pet name and a uid and calls pet_send_mail() or pet_send_one_mail(). Preview bypass is an interesting idea though. Would it just look like:

/pet/pet_name?uid=specific_uid&preview=FALSE

?

j4’s picture

Hi,

Thanks for taking the time! I am always in awe when a drupal module developer takes time off to answer people like me, as you guys are continuously giving so much to the community!

Yes it would be great to be able to bypass the preview page with a url like what you have written or have a checkbox while the admin is creating the template as to whether he wants the preview email facility for this template or not. Makes sense?

As i am not a php expert..(am an analytical chemist who has fallen in love with drupal!), i will not be able to make much headway with the advice you have given regarding the menu callback. But will keep visiting this page for any progress on the preview bypass.

Thanks once again.
Jaya

dwightaspinwall’s picture

Status: Active » Closed (won't fix)

I've decided not to fix this, as I have too many other priorities. You can always send the email programmatically if you wish (or via Rules in the D7 version) which will bypass the interactive preview.