Jump to content
adrian

Email New User

Recommended Posts

Hi Guys,

Just installed and tested the module and my email came out like this:

659563587_Schermafbeelding2019-06-04om15_47_38.png.2ef1294b37ba7d8a23c0a0e1f1e27c1b.png

Any ideas on how to fix this? Thanks in advance 🙂

Share this post


Link to post
Share on other sites

@bramwolf - does it make a difference if you use a different email client? What are you using?

 

Share this post


Link to post
Share on other sites

Hi Adrian,

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

 

Grts

Bram

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
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.. 😕

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

I checked a email from the frombuilder and got the same result.

756290125_Schermafbeelding2019-06-05om15_04_54.png.f40991e7764580b43f4f487a966c5b9b.png

I never had this problem before with any other processwire sites I have. Any ideas on what could cause it?
Thanks in advance 🙂

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
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?

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Just now, gerritvanaaken said:

Do you have a small hint in which format I set line breaks?

I would go with double quotes and \n

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Robin S
      This module is sort of an upgrade to my earlier ImageToMarkdown module, and might be useful to anyone working with Markdown in ProcessWire.
      Copy Markdown
      Adds icons to images and files that allow you to copy a Markdown string to the clipboard. When you click the icon a message at the top left of the screen notifies you that the copying has occurred.
      Screencast

      Note: in the screencast an EasyMDE inputfield is used to preview the Markdown. It's not required to use EasyMDE - an ordinary textarea field could be used.
      Usage: Images
      When you hover on an item in an Images field an asterisk icon appears on the thumbnail. Click the icon to copy an image Markdown string to clipboard. If the "Description" field is populated it is used as the alt text.
      You can also open the "Variations" modal for an image and click the asterisk icon to copy an image Markdown string for an individual variation.
      Usage: Files
      When you hover on an item in a Files field an asterisk icon appears next to the filename. Click the icon to copy a link Markdown string to the clipboard. If the "Description" field is populated it is used as the link text, otherwise the filename is used.
       
      https://github.com/Toutouwai/CopyMarkdown
      https://processwire.com/modules/copy-markdown/
    • By Cybermano
      Food Allergens Module
      A simple List of Food Allergens
      My needs were to provide a simple list of food allergens for our clients with restaurant related activity.
      The idea was to simply output the list (to speed up the data entry) without leaving the food menu editing, eg. opening another page in new tab or window.
      This isn't a perfect solution, but it works fine for my needs and I decided to share the base idea.
      This could also be easily used to show little notes or short "vademecum", not only for the list of food allergens.
      ---
      Main features
      The basis
      All moves from a short editing of the module in this tutorial: How to create custom admin pages by @bernhard
      First of all it creates an empty admin page, with a dedicated permission to let safe-user to see it (this permission has to be created as a new ones, manually or by the module).
      Once the page is created, I have hooked its behaviour into the ready.php, to show the content (basically a list).
      A step further
      With the tips of  @bernhard, @Soma (and many others), see here , the magic happens. 
      The new page will be shown as a panel, so editors will not abandon their data entry to have a quick view to the list.
      A little further
      Why scroll to the top of the page to click a link?
      The next step was to create a sticky button only in the food menu pages.
      Again with a @bernhard tip I moved into the customization of this simple module and the related hook.
      ---
      How to use this module
      After installed, it creates the page /admin/page/allergens/ and the module is to be setted up. The first field is a CKEditor with multi-language. This is the place where to write the informations that will be shown into the page. The next field is a simply text-area where to place a bit of JS that will be appended to the markup of the text (omit the 'script' tags). I also putted a checkbox with a silly statement: this to think at least twice on the safety of the written JS. Now comes the first way to display the link to the page
      Field Note with Link. Enable and save it. The module will display a new row with 4 selects (1 standard and 3 ASM):
      View mode (to show the page as Panel or as Modal PopUp); Templates to select: select one or more and save before proceed, so the  asm-select of the pages will be populated showing all the pages of the selected templates. Pages to select: also here select at least one and save before proceed to populate the asm-select for fields only with the ones that belong to the selected pages. Select the fields where to place the note and save again. That's all: now you will find into the notes of the selected fields the link "See the List of Allergens".
      At the same way, the option for the sticky button, but with a plus
      The field select is obviously unnecessary, but you could play with the last row: the inline styles to fix your sticky button where you like. Here you could set the sticky position of the <div> and the absolute ones of the <a>.

      Video Explanation
      In these screencasts you could see a custom JS that show a "copy" button near a "hanna-code" call.
      This because I've set a specific one for each allergen to show up a tooltip in the front end.

      Registrazione #33.mp4  

      Registrazione #34.mp4 ---
      Last but not the least
      Actually it works fine for my needs, even if it's much improvable: I'm working on the permissions creation, the uninstall section, a separate configs and defaults and how to include the hook into the module leaving free the ready.php. According to a simpler uninstall. Also I would make the link text as a dynamic text field, so it will be more flexible.
      I always learn a lot here, so I would share my code for whom it could be interested.
      I removed the hanna code references, but I provide you the html list of the allergens, English and Italian too, so you can paste them into the "source" of the CKEditor field to have a ready to use module.
      Obviously you are free to modify the code as per your needs.
      Please, keep in mind that I'm not a pro coder and I beg your pardon for my verbosity (speaking and coding). 😉
      I hope be helpful or for inspiration.
      Bye
      ready.phpList-ITA.htmlList-ENG.htmlAllergens.moduleREADME.md
       
    • By BitPoet
      I've realized that I've been jumping back and forth between the PW API docs and the source code for site modules far too much. The idea to hold all necessary documentation locally in one place has occurred to me before, but getting PHPDocumentor et al set up and running reliably (and producing readable output) as always been too much of a hassle. Today I was asked how I find the right hooks and their arguments, and that inspired me to finally get my backside down on the chair and whip something up, namely the
      Module Api Doc Viewer
      ProcessModuleApiDoc
      It lets you browse the inline documentation and public (optionally also protected) class/method/property information for all modules, core classes and template files in the ProcessWire instance. The documentation is generated on the fly, so you don't have to remember to update your docs whenever you update a module.
      The module is quite fresh, so expect some bugs there. Behind the scenes it uses PHP-Parser together with a custom class that extracts the information I needed, and the core TextformatterMarkdownExtra module for rendering the description part in the phpdoc style comments.
      This is not a replacement / competitor to the API Viewer included in the commercial ProDevTools package. There is quite some information included in the inline documentation that my module can't (and won't) parse, but which makes up parts of the official ProcessWire API docs.
      This, instead, is a kind of Swiss army knife to view PHPDoc style information and get a quick class or function reference.
      If you feel daring and want to give it a spin, or if you just want to read a bit more, visit the module's GitHub repository.
      This is the overview page under "Setup" -> "Module API Docs":

      And this is what the documentation for an individual class looks like:

      The core module documentation can of course be found online, but it didn't make sense not to include them.
      Let me know what you think!

    • By tcnet
      File Manager for ProcessWire is a module to manager files and folders from the CMS backend. It supports creating, deleting, renaming, packing, unpacking, uploading, downloading and editing of files and folders. The integrated code editor ACE supports highlighting of all common programming languages.
      https://github.com/techcnet/ProcessFileManager

      Warning
      This module is probably the most powerful module. You might destroy your processwire installation if you don't exactly know what you doing. Be careful and use it at your own risk!
      ACE code editor
      This module uses ACE code editor available from: https://github.com/ajaxorg/ace

      Dragscroll
      This module uses the JavaScript dragscroll available from: http://github.com/asvd/dragscroll. Dragscroll adds the ability to drag the table horizontally with the mouse pointer.
      PHP File Manager
      This module uses a modified version of PHP File Manager available from: https://github.com/alexantr/filemanager
       
    • By teppo
      Admin Restrict Branch Select is an add-on / companion module for Admin Restrict Branch. With this module enabled, you can manually select more than one branch parent per user via the branch_parent field, and users with more than one option selected will be able to switch between those while editing site content. Switching between branches is done via a select field injected at the top of the page tree.
      Note that users are still limited to one branch at a time: this module will not make it possible to view multiple branches at the same time.
      When the module is installed, it will automatically update the branch_parent field if deemed necessary, i.e. if it isn't yet configured to allow selecting multiple pages. You can make changes to the field later, if you want to restrict selectable options by template, use asmSelect instead of PageListSelectMultiple, etc. 
      This is an early beta release, so be sure to test carefully before enabling this module in production!
      https://processwire.com/modules/admin-restrict-branch-select/
      https://github.com/teppokoivula/AdminRestrictBranchSelect
×
×
  • Create New...