How to set dynamically FROM or REPLY-TO with "share page" Email?

I would like to set FROM (better REPLY-TO) to the current users email address “$xwiki.user.getEmail()”, especially within “share page”.

Just setting values to “Email address sent from” to “xwiki.user.getEmail()” or “$xwiki.user.getEmail()” or something like “smtp.mail.from=…” in “Additional Properties” does not work.

(Users typically use the “reply”-button of their email client …)

Is this configuration possible ?

Norbert

1 Like

Hi Norbert.

I know I’m reviving an old thread but couldn’t find any newer or answered one and this asks the perfect question. Users are answering via mail their received suggestions and only we as admins getting the replies.

Where did you try to set FROM or REPLY-TO? In /edit/XWiki/SharePage?editor=object I can see only fields like “subject”, “language”, “text” or “html”. What do you mean by “Additional Properties”?

Maybe add a property to this class /edit/XWiki/Mail?editor=class?

Is someone outside with an answer today?
Regards, SImpel

Hi,

I have not found any way to configure it.
Instead, I choose a “dirty solution” and changed the code in /webapps/xwiki/templates/shareinline.vm

Only one line (10) has to be changed.

Screenshot from our “XWiki - Do not forget this changes, when upgrading” - documentation:

mod shareinline.vm

The text

Just setting values to “Email address sent from” to “xwiki.user.getEmail()” or “$xwiki.user.getEmail()” or something like “smtp.mail.from=…” in “Additional Properties” does not work.

refers to some tries to set new key/value pairs in mail section of xwiki.properties. Those were simply unsuccessful attempts.

Of course, I would prefer a standard configuration option …

Norbert

1 Like

Not possible ATM.

Feel free to open a jira issue for this improvement.

I can think of 2 solutions out of the top of my head:

  • A configuration option (implementation: provide a component hint in the config so that it’s extensible)
  • Display a FROM UI field in the Share Page UI, prefilled with some value but allowing the user to override it. There’s still probably a need to define the default prefilled value.