How can I send an email to all of my users?
Thanks,
Gio
Email customers?
- gio50000
- Commander (CMDR)
- Posts: 123
- Joined: Mon Feb 18, 2008 12:51 pm
- Location: Orlando, FL
- Contact:
Email customers?
Thank you,
Gio
Gio
- gio50000
- Commander (CMDR)
- Posts: 123
- Joined: Mon Feb 18, 2008 12:51 pm
- Location: Orlando, FL
- Contact:
Re: Email customers?
I created an email list to contact users. Is there a way to add all users at once rather than one at a time?
Gio
Gio
Thank you,
Gio
Gio
Re: Email customers?
You have to add the customers one by one to the Email list.
Re: Email customers?
Here is the helper code. The following changes will make two buttons available on the ManageUsers page will allow you to add/remove all users from the Email list in one go.
Please take backup of your Admin\Marketing\Email\ManageUsers.aspx and Admin\Marketing\Email\ManageUsers.aspx.cs files before making these changes.
Edit your Admin\Marketing\Email\ManageUsers.aspx file and locate the following line of code
and put the following code just above it so that it should look like as below
Now edit your Admin\Marketing\Email\ManageUsers.aspx.cs file and add following two methods to it
Please take backup of your Admin\Marketing\Email\ManageUsers.aspx and Admin\Marketing\Email\ManageUsers.aspx.cs files before making these changes.
Edit your Admin\Marketing\Email\ManageUsers.aspx file and locate the following line of code
Code: Select all
<asp:ObjectDataSource ID="SearchUsersDs" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="FindUsersByName" TypeName="CommerceBuilder.Users.UserDataSource"
Code: Select all
<asp:Button ID="AddAllUsersButton" runat="server" OnClientClick="return confirm('Do you want to add all users to this Email list?');" OnClick="AddAllUsersButton_Click"
Text="Add All" />
<asp:Button ID="RemoveAllUsersButton" runat="server" OnClick="RemoveAllUsersButton_Click" OnClientClick="return confirm('Do you want to remove all users from this Email list?');"
Text="Remove All" /><br />
<asp:ObjectDataSource ID="SearchUsersDs" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="FindUsersByName" TypeName="CommerceBuilder.Users.UserDataSource"
Code: Select all
protected void AddAllUsersButton_Click(object sender, EventArgs e)
{
UserCollection users = UserDataSource.FindUsersByName(String.Empty,UserDataSource.NameSearchField.Email);
foreach (User user in users)
{
if(!_EmailList.IsMember(user.UserName))
_EmailList.AddMember(user.UserName, LocaleHelper.LocalNow, Request.UserHostAddress);
}
Response.Redirect(Request.Url.ToString());
}
protected void RemoveAllUsersButton_Click(object sender, EventArgs e)
{
UserCollection users = UserDataSource.FindUsersByName(String.Empty, UserDataSource.NameSearchField.Email);
foreach (User user in users)
{
if (_EmailList.IsMember(user.UserName))
_EmailList.RemoveMember(user.UserName);
}
Response.Redirect(Request.Url.ToString());
}
Re: Email customers?
That's great. The option for adding or removing the users in bulk will be very helpful, so I just created an enhancement request for the future version.