Replies: 4 comments
-
Okay, I think this is a very specific requirement and I don't think it really fits the general purpose approach of this plugin. But while looking at your problem I've noticed that the link field currently actually does not offer any tools to modify the returned url, which basically is what you need in this case. Starting with the v2.0.0-beta.10 the link field now accepts an option parameter that can be passed to the url getter that can manipulate the returned url. In a twig template we can now do this to append a query string to the url: myLinkField.getUrl({
query: 'subject=Custom+mail+subject&body=Custom+mail+body'
}) The query parameter also accepts an array: myLinkField.getUrl({
query: {
subject: 'Custom mail subject',
body: 'Custom mail body',
}
}) Actually all url parts that are returned by myLinkField.getUrl({
fragment: 'myAnchor',
scheme: 'https',
}) When rendering a complete link via myLinkField.getLink({
class: 'customLinkClass',
href: {
query: {
subject: 'Custom mail subject',
body: 'Custom mail body',
}
}
}) |
Beta Was this translation helpful? Give feedback.
-
I think it would be great to support a subject and possibly other fields for an email basis, there are options for different types already, and it would be great to have this functionality built in with the conditional options showing rather than having to build in extra logic. My use-case if building out link in a matrix field where I don't want to have to create additional fields which may not be relevant to other types. |
Beta Was this translation helpful? Give feedback.
-
I found out using the |
Beta Was this translation helpful? Give feedback.
-
Wanted to add that I'm also looking for a solution to this. Will test above but having an additional subject field available for email would be really great. |
Beta Was this translation helpful? Give feedback.
-
This is an edge case but we just got a request from a client for this and it may be an easy feature to implement (that I don't know of course).
Take a look here: https://css-tricks.com/snippets/html/mailto-links/
It would be great if we had a subject field and maybe CC, BCC when choosing the e-mail option (even a body field, but that's maybe to much a hassle for the UI).
Update
As a workaround I now did this in Twig:
Beta Was this translation helpful? Give feedback.
All reactions