Jump to content

Email New User


adrian

Recommended Posts

49 minutes ago, bramwolf said:

I don't think so, got the same formatting on Apple mail and android

What about the email provider? Can you try to a gmail address to confirm the problem?

Link to comment
Share on other sites

I tried it with a Gmail account but got the same results. It's like the header isn't configured properly?
the encoding type should be sent as a header not as the  message. However I don't know why that
is happening or where I could change it.. ?

Link to comment
Share on other sites

2 hours ago, bramwolf said:

I tried it with a Gmail account but got the same results. It's like the header isn't configured properly?
the encoding type should be sent as a header not as the  message. However I don't know why that
is happening or where I could change it.. ?

Are other html emails from your system (sent with a wireMail) working as expected? In other words, is it only emails from this module that are the problem?

Link to comment
Share on other sites

  • 7 months later...

Is it possible to have different welcome messages for different User-Roles? I use the module via API. Maybe it’s possible to manually choose an email template file for each welcome message, something like this:

$u = new User();
$u->name = "foo";
$u->pass = randomPassword();
$u->sendEmail = true;
$u->welcomeMessageFile = '/some/path/client.txt';
$u->save()

My client has a bunch of different user types that need a variety of welcome texts. Any idea how I could accomplish that?

Link to comment
Share on other sites

Hi @gerritvanaaken - please grab the latest version just committed and use:

$u->emailMessage = 'My custom message';

Obviously you can wrap this in a conditional and define it differently for each required role.

I think the idea of a template file could also be good and am certainly not against implementing it - this was just quicker to do for now ?

Perhaps if you still want the file approach, you'd be willing to put together a PR?

Link to comment
Share on other sites

Actually, the problem with the template file setup is handling multi-language version of the message body. I am thinking that perhaps I'll add a new collapsed fieldset to the module settings that has a field for each role (complete with multi-language support, as the current main "Email Body" field has). 

Any thoughts on this approach?

Link to comment
Share on other sites

Wow, @adrian – that looks good, it might be exactly what I need for my client. I’ll chedk this out in the next few days. Do you have a small hint in which format I set line breaks?

$u->emailMessage = "Hello {name}\n\nwelcome to the show";

or better this way?

$u->emailMessage = 'Hello {name}

welcome to the show';

 

  • Like 1
Link to comment
Share on other sites

4 hours ago, adrian said:

Actually, the problem with the template file setup is handling multi-language version of the message body. I am thinking that perhaps I'll add a new collapsed fieldset to the module settings that has a field for each role (complete with multi-language support, as the current main "Email Body" field has). 

Any thoughts on this approach?

One field for each role could cause problems, because a new user might have more than one role. Then: which message do you send? All of them? You would need some complicated conditional logic in the UI. Not all that easy.

  • Like 2
Link to comment
Share on other sites

  • 5 months later...

I'm having an issue with  PW 3.0.163 and this module 1.1.12 where the initial option to send welcome message is not present, however the 'Re-send welcome message' option is present after saving a user.

I think I used an earlier version of the module that didn't require the user to have the permission edit-profile, and that worked OK.

I think the permission profile-edit is not being set until after the user is already published, so the initial option to send the welcome message is never shown.

Link to comment
Share on other sites

Sorry about @Kiwi Chris - I didn't consider that on initial user creation, extra roles won't have been checked yet. I have removed that profile-edit requirement to show the email field, although I added a showIf check to make sure at least one additional role (not just guest) has been checked. After all, if we're going to email someone their password, they need to be able to edit their profile to change it.

Let me know if this version seems OK to you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...