Change Form submission reply-to email address
Is there a way to change the "reply-to" address on the email notification from the forms module to default to the person's email address that is completing the contact form? Currently it defaults to the provider email address. It would be better for the staff who receives the email to be able to just reply to the customer directly from the email that is sent to their inbox.
Thanks
I would be interested in this as well. Our form notifications are usually sent to our support team, and it would be better for them to click "Reply" and have the form-submitter's email address automatically entered into the To: field. Is there a way to do this?
Hi,
There is no way to change the reply-to email address as it is using the email entered as the DefaultSenderEmailAddress in the notifications settings.
There is a way to achieve your desired behavior of having the user's email in the notifications. You can do this by creating a custom form widget. To simplify your work you can use Thunder visual studio extension to create the form widget for you.
The best approach would be to have a HiddenField in the template and set its value to the current user's email (if such exists) on the InitializeControls method.
Template:
<%@ Control %>
<%@ Register Assembly="Telerik.Sitefinity" TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" %>
<
asp:HiddenField
ID
=
"EmailTextBox"
runat
=
"server"
/>
public
override
object
Value
get
return
this
.EmailTextBox.Value;
set
this
.EmailTextBox.Value = value.ToString();
protected
virtual
HiddenField EmailTextBox
get
return
this
.Container.GetControl<HiddenField>(
"EmailTextBox"
,
true
);
protected
override
void
InitializeControls(GenericContainer container)
this
.EmailTextBox.Value = GetCurrentSitefinityUserEmail();
private
static
string
GetCurrentSitefinityUserEmail()
ProfileView pv =
new
ProfileView();
Guid currentUserGuid = pv.CurrentUser.UserId;
if
(currentUserGuid != Guid.Empty)
var user = UserManager.GetManager().GetUser(currentUserGuid);
if
(user !=
null
)
return
user.Email;
return
String.Empty;
This post is a little old now, but I'm trying to do the same kind of thing. I need the reply-to to be an email address set by the user when they fill out the form. I don't see where in the example above this affects the reply-to of the email. It looks to me to just be setting a hidden field. How does this get into the reply-to email field?
Thanks...