Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By argash on
I'm sorry if this is something simple but I can't find an answer anywhere.
I'm having a problem with people who have set up email notifications for content and comments where the email notification appears to be sent by me rather than the content poster so when these people hit reply their reply is sent to me. I'd like to either change it so that the from field is the posters email or just disable the feature entirely. Like I said I've been unable to find an answer for either solution so any help would be greatly appreciated.
-Erik
Comments
I've spent all night trying
I've spent all night trying to find a solution with still no luck anyone else have a clue what I need to do?
ok best I can tell is it's
ok best I can tell is it's related to on of the OG modules but I still cant find where to fix it. Does anyone have any ideas?
quick fix to "From:" field on OG's outgoing email
I had to track this down myself recently, but for a slightly different reason. Here's what I found:
In og.module, there's a function called og_mail($type, $obj). At the bottom of this function, at line 1737, you'll see the following code:
The reason the email is getting sent out with the user's name, but your site's email address, is all due to this bit of the code:
You really want to change $sitemail with the email of the user who posted the item. Now, if you're comfortable making a hack to the module itself, you could probably just replace that bit of code with this:
BUT, note that $obj->mail isn't set on its own, so you'll have to add code to do that somewhere earlier in the og_mail function. You might add something like this right above line 1737:
I haven't tested this myself, but hopefully this gives you an idea of what you need to do. Also, note that hacking the og module itself means you'll have to be careful should you decide up to upgrade the module later (you could wipe out your changes.)
Good luck,
-A
PS: You might want to keep an eye on this discussion with the module maintainer: http://drupal.org/node/174045
aasarava, thank you so much
aasarava, thank you so much for this! I posted to that discussion and within two hours you had this solution, so I really appreciate it. It works perfectly! I hope that at some point in the near future this can get included in OG as an option, but until then this is a very easy solution.
Now if I could just figure out how to get group by content type view on the OG home pages, I would be home free!
No problem. Glad it works!
No problem. Glad it works!