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.
I wrote this button for a project and I thought it might help someone else so I decided to share it instead to leave it in one of my custom modules.
Patch attached in my next comment.
Regards.
Comment | File | Size | Author |
---|---|---|---|
#9 | 2899517-8-9-interdiff.txt | 7.13 KB | gnuget |
#9 | 2899517-9.patch | 8.21 KB | gnuget |
#8 | 2899517-8.patch | 2.46 KB | gnuget |
#8 | 2899517-2-8-interdiff.txt | 387 bytes | gnuget |
#2 | 2899517-mail-button.patch | 2.48 KB | gnuget |
|
Comments
Comment #2
gnugetPatch attached.
Comment #3
nedjoThanks, this will indeed be useful for others.
Sharing via email has some complexities in that we need to know what email(s) to send to and may want for example a default email that goes out. Rather than providing a simple email link, another option would be to integrate with Forward, which handles a lot of the harder problems. That's what was done for example in the Service Links module in Drupal 7 to provide a mail forwarding link. We can't use that code directly, but it might be useful as a model.
Comment #4
flocondetoileThanks @Gnuget.
Yes, providing a default email body based on the current entity could be useful. Quickly look at Forward module. Seems that this could be "easily" integrated if we build a link based on the forward module route : /forward/{entity_type}/{entity}.
Comment #5
gnugetLooks great the Forward module.
I will try to work on this, this week.
Comment #6
mlncn CreditAttribution: mlncn at Agaric for Drutopia, Portside, MASS Design Group, National Institute for Children's Health Quality commentedI think the option as is should go in; integration with the forward module could be optional if the forward module is available.
Not sending the e-mail ourselves, but opening it in the visitor's e-mail program, can be seen as a *feature* in that it avoids opening a potential avenue for a site being used in sending spam.
Comment #7
nedjoJust from looking at the code, it looks like the email would be addressed to theemail@email.com and in their email program a user would need to delete that email address and then select the one they want to use. If so that seems like a usability issue.
Comment #8
gnugetWhile I have the time to work on the Forward module integration I just removed the default mail fixing the usability problem mentioned by Nedjo on #7.
Patch attached.
David.
Comment #9
gnugetHi!
Today I finally was able to work on this.
On this patch the following changes:
I think this is almost ready to be committed :-)
Let me know.
Thanks!
Comment #11
flocondetoileHi @gnuget
Sorry for the delay, I was busy on some others projects.
Your patch looks very fine.
Commited.
I just updated this part to add the page title on the mail body too.
Thanks for your work.
And I thank you for your nice and useful blog post (I set a link on the module page)
Comment #12
flocondetoile