<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Sending twice mail</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119825506" />
  <subtitle>Sending twice mail</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119825506</id>
  <updated>2026-04-05T03:20:12Z</updated>
  <dc:date>2026-04-05T03:20:12Z</dc:date>
  <entry>
    <title>RE: Sending twice mail</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119840481" />
    <author>
      <name>Piotr Krzesniak</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119840481</id>
    <updated>2020-08-26T05:56:40Z</updated>
    <published>2020-08-26T05:56:40Z</published>
    <summary type="html">Okay, thank you for helping &lt;img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" &gt;</summary>
    <dc:creator>Piotr Krzesniak</dc:creator>
    <dc:date>2020-08-26T05:56:40Z</dc:date>
  </entry>
  <entry>
    <title>RE: Sending twice mail</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119835683" />
    <author>
      <name>Krzysztof Gołębiowski</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119835683</id>
    <updated>2020-08-25T09:55:12Z</updated>
    <published>2020-08-25T09:55:12Z</published>
    <summary type="html">Hi Piotr,&lt;br /&gt;I haven&amp;#39;t used this feature for a bit, but I guess that one is just the &amp;#34;email verification&amp;#34; which should be sent first and then after it is successfully verified, the second one is sent as an account creation confirmation. You can set localized text for both of them in &amp;#34;Instance Settings&amp;#34; -&amp;gt; &amp;#34;Email&amp;#34;.&lt;br /&gt;&lt;br /&gt;In Liferay, some actions are executed based on &lt;em&gt;serviceContext&lt;/em&gt; parameter, the last in &lt;em&gt;addUser&lt;/em&gt; method which is &lt;em&gt;null&lt;/em&gt; in your case. One of them is &lt;em&gt;portalUrl&lt;/em&gt;, which is used to generate the hostname for the email. I don&amp;#39;t know why both the emails are sent at the same time, but maybe it&amp;#39;s also caused by missing &lt;em&gt;serviceContext&lt;/em&gt; paramters. The best way to find that out would be to check the original source code in &lt;a href="https://github.com/liferay/liferay-portal/blob/master/portal-impl/src/com/liferay/portal/service/impl/UserLocalServiceImpl.java#L996"&gt;UserLocalServiceImpl&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;KG</summary>
    <dc:creator>Krzysztof Gołębiowski</dc:creator>
    <dc:date>2020-08-25T09:55:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: Sending twice mail</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119835284" />
    <author>
      <name>Piotr Krzesniak</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119835284</id>
    <updated>2020-08-25T08:19:25Z</updated>
    <published>2020-08-25T08:19:25Z</published>
    <summary type="html">Anyone ?</summary>
    <dc:creator>Piotr Krzesniak</dc:creator>
    <dc:date>2020-08-25T08:19:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: Sending twice mail</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119825867" />
    <author>
      <name>Piotr Krzesniak</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119825867</id>
    <updated>2020-08-24T08:00:12Z</updated>
    <published>2020-08-24T08:00:12Z</published>
    <summary type="html">Version: &lt;strong&gt;Liferay 7.3.4 GA5&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;This is my addUser method, here i set up where to send emails. For testing purposes i hardcoded my private mail peterczak@wp.pl&lt;strong&gt; &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;try {&lt;br /&gt;            UserLocalServiceUtil.addUser(&lt;br /&gt;                    0, //creatorUserId&lt;br /&gt;                    companyId, //companyId&lt;br /&gt;                    true, //autoPassword&lt;br /&gt;                    &amp;#34;password&amp;#34;, //password1&lt;br /&gt;                    null, //password2&lt;br /&gt;                    false, //autoScreenName&lt;br /&gt;                    &amp;#34;Krzesniakowo&amp;#34;, //screenName&lt;br /&gt;                    &amp;#34;peterczak@wp.pl&amp;#34;, //emailAddress&lt;br /&gt;                    0, //facebookId&lt;br /&gt;                    null, //openId&lt;br /&gt;                    LocaleUtil.getDefault(), //locale&lt;br /&gt;                    &amp;#34;Piotr&amp;#34;, //firstName&lt;br /&gt;                    &amp;#34;Jan&amp;#34;, //middleName&lt;br /&gt;                    &amp;#34;Krzesniak&amp;#34;, //lastName&lt;br /&gt;                    0, //prefixId&lt;br /&gt;                    0, //suffixId&lt;br /&gt;                    false, //male&lt;br /&gt;                    0, //birthdayMonth&lt;br /&gt;                    1, //birthdayDay&lt;br /&gt;                    1970, //birthdayYear&lt;br /&gt;                    null, //jobTitle&lt;br /&gt;                    null, //groupIds&lt;br /&gt;                    null, //organizationIds&lt;br /&gt;                    null, //roleIds&lt;br /&gt;                    null, //userGroupIds&lt;br /&gt;                    true, //sendEmail&lt;br /&gt;                    null);&lt;br /&gt;        } catch (Exception e) {&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;​​​​​​​&lt;/strong&gt;in the attachment I am sending photos of my received messages from the server and a sample e-mail. As you can see they are doubled. OPEC is my email sender, i configured this in instance settings -&amp;gt; email sender.  And the whole configuration of mail is made in Control Panel &amp;gt; Server Administration &amp;gt; Mail. &lt;br /&gt;&lt;blockquote&gt;Was it always like this? Did you upgrade from a previous version?&lt;br /&gt;&lt;/blockquote&gt;I haven&amp;#39;t done this before, its my first time i used this method.</summary>
    <dc:creator>Piotr Krzesniak</dc:creator>
    <dc:date>2020-08-24T08:00:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: Sending twice mail</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119827206" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119827206</id>
    <updated>2020-08-24T07:24:22Z</updated>
    <published>2020-08-24T07:24:22Z</published>
    <summary type="html">More steps to reproduce please.&lt;br /&gt;(&lt;em&gt;exact&lt;/em&gt;) version? Who are the mails addressed to? (both to the same account?) How did you set this up? Was it always like this? Did you upgrade from a previous version?</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2020-08-24T07:24:22Z</dc:date>
  </entry>
  <entry>
    <title>Sending twice mail</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119825505" />
    <author>
      <name>Piotr Krzesniak</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119825505</id>
    <updated>2020-08-24T07:00:03Z</updated>
    <published>2020-08-24T07:00:03Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hello,&amp;nbsp; I use a method addUser and set a boolean flag sendEmails to true from a class UserLocalServiceImpl to send an email verification. Unfortunately, i came across to 2 problems.&amp;nbsp;&lt;br&gt;1) Why do i receive 2 the same emails, one is written in english and second one in my native language ? Obviously, i want to receive only one mail which will be written in the selected default language for the page.&lt;br&gt;2)My url verification always contains 2 nulls. It looks like this&amp;nbsp;nullnull/portal/update_password?ticketKey=5c795f5b-6056-e95e-54fa-72a052247dc4.&amp;nbsp;Thanks in advance : )&lt;br&gt;&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Piotr Krzesniak</dc:creator>
    <dc:date>2020-08-24T07:00:03Z</dc:date>
  </entry>
</feed>
