<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi Mike,</p>
    <p>what about trying <b>userPasswordNotifier</b>? It is very
      similar to accountPasswordNotifier, but it uses midPoint password
      and not account password.</p>
    <p>If you create users and generate their passwords in a single
      step, this might well be what you want.</p>
    <p>See also:
      <a class="moz-txt-link-freetext" href="https://docs.evolveum.com/midpoint/guides/notifications-howto/">https://docs.evolveum.com/midpoint/guides/notifications-howto/</a></p>
    <p>Best regards,</p>
    <p>Ivan<br>
    </p>
    <div class="moz-cite-prefix">On 18. 8. 2025 12:12,
      mikhail.nikolaenko via midPoint wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:dV9xSkVjW6wzqtf3wUvE6B957daRhpKRxsKaal65TMQkdyiDBTz9SVlBDOlxcSbf6lnqmr5v2bVTToaOIyxI_cUtiiSZFN0UUHB8QNZtUIs=@proton.me">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <p data-start="146" data-end="169">Hello dear community,</p>
      <p data-start="171" data-end="359">We have the following business
        requirement: when a new user is created, the system must send a
        welcome email to their private email address containing some
        text and the initial password.</p>
      <p data-start="361" data-end="513">My first idea was to use <strong
          data-start="386" data-end="408">simpleUserNotifier</strong>
        for the <b><em data-start="417" data-end="422">add</em> </b>operation.
        However, I was not able to find a way to access the newly
        generated password.</p>
      <p data-start="515" data-end="698">As an alternative, I used <strong
          data-start="541" data-end="568">accountPasswordNotifier</strong>,
        and from there I can send the welcome email with the password.
        This works, but now I need to ensure that it happens only once.</p>
      <p data-start="700" data-end="973">As soon as the email is
        successfully sent (sure we could not be sure if it was
        delivered, but at least send operation has been completed
        without error), no further emails should be triggered by
        password changes in midPoint. My first thought was to follow a
        common approach by using a custom attribute like <em
          data-start="896" data-end="915">isWelcomeMailSent</em>, and
        setting it to <em data-start="935" data-end="941">true</em>
        once the email has been sent.</p>
      <p data-start="975" data-end="1240">So my question is: how can I
        modify a person attribute at the moment the email is sent? Is it
        possible to do this directly from the notification script? Or
        perhaps I was wrong, and there is actually a way to access the
        new password in the <em data-start="1214" data-end="1219">add</em>
        operation context?</p>
      <p data-start="1242" data-end="1264">Best regards,<br
          data-start="1255" data-end="1258">
        Mike</p>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre wrap="" class="moz-quote-pre">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="https://lists.evolveum.com/mailman/listinfo/midpoint">https://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Ivan Noris
Expert Identity Engineer
evolveum.com
</pre>
  </body>
</html>