Is it possible to customize the registration email depending on the role choosed by the user?
Is there any variable in the !username which could be used to send one or another message or i should patch the .module?
Thanks in advance,
regards.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | autoassignrole-267848-12.patch | 6.49 KB | fuerst |
| #11 | autoassignrole-267848-11.patch | 6.55 KB | fuerst |
| #8 | autoassignrole-267848-8.patch | 6.57 KB | fuerst |
Comments
Comment #1
menoseficaz commentedI'm looking for the same thing - seems like it would be a common request with this module. Let me know if you come up with a hack and please post it here. Thanks!
Comment #2
cyberswat commentedI'm going to move this over to a feature request.
Comment #3
manoloka commentedI subscribe.
I think it's a must for this module.
Thanks, great module BTW
Comment #4
AmitV-2 commentedSubscribing
Comment #5
pipesd commentedSubscribing
Comment #6
Michsk commentedsubscribing, this is a module with lot of potential
Comment #7
cyberswat commentedI think this is a good idea but am not going to support it without additional support from the community in the form of patches.
Comment #8
fuerst commentedPlease review the attached patch which provides the function described in the issue.
It uses
hook_mail_alter()to replace the Welcome email generated by the user.module with role dependent text.After applying the patch and running update.php you can configure the Subject and Body of the Welcome email for every role independently in the Assign from path section of the Auto Assign Role settings page.
I'm not sure if my approach to overwrite the email body generated by the user.module will work for every situation. I currently just overwrite the first element of the
$message['body']array. Once another module useshook_mail_alter()to add more text to the$message['body']array and reorders its elements my approach may fail. Feel free to suggest a solution if you have one.I also decided to overwrite every Welcome email regardless of it's type which are
I think that's ok because once you use the Email customization feature provided by this patch you exactly know what email text you want to send your users.
Note: From within the autoassignrole module directory use the -p1 switch to the patch command to apply this patch.
Comment #10
cyberswat commented@fuerst the patch failed to apply in automated testing likely due to needing the -p1 instead of a -p0 ... can you correct this?
Comment #11
fuerst commentedHere it is.
Comment #12
fuerst commentedCorrected patch: replacement of email subject or body only takes place if it is not empty. That way you can leave the body field empty and get the subject still replaced.
Comment #13
fuerst commentedI do have this patch working well at a production site.
Does it get a chance to get into the next release?
Comment #14
cyberswat commentedJust waiting on someone to verify that it has been RTBC and is ready to go and it will be committed.
Comment #15
ethnovode commentedHello,
I use autoassignrole with no automatic role but I let the user choose his role with radio buttons. I would love this feature but after looking at your patch it seems that it only works if I set the role to be automatic. Would it be possible to put this (very nice) option in a new fieldset and let it available so we can use it even if you don't have the assignment automatic ?
Comment #16
fuerst commentedWould it be ok to set the role dependent email messages regardless of any assigning mode (path, automatic or user choosen).
@cbyerswat: What do you think about this? Doesn't make sense to implement the feature when it will not be included, of course.
Comment #17
itserich commentedAny word on this? With all the user modules I am surprised there is no way to send a message customized per role.
Comment #18
Ela commentedsubscribing
Comment #19
chuckbar77 commentedsubscribing
Comment #20
emergencyofstate commentedsubscribing. Is this functionality planned for the 7 version as well? I'm using that one.
Comment #21
fuerst commentedJust set the Status of this issue to "reviewed & tested by the community" if the patch works for you. That way the maintainer knows it is working and may include it in the next release.
Comment #22
xbery commented#12: autoassignrole-267848-12.patch queued for re-testing.
Comment #23
Enemy commented#11: autoassignrole-267848-11.patch queued for re-testing.
Comment #24
chinita7 commentedsubscribing