<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: 'Add members and notify them via email' in Hub through python api in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-members-and-notify-them-via-email-in-hub/m-p/1482344#M10093</link>
    <description>&lt;P&gt;What just worked for me was:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create the user&lt;UL&gt;&lt;LI&gt;&lt;DIV&gt;&lt;SPAN&gt;gis&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;users&lt;/SPAN&gt;&lt;SPAN&gt;.create(&lt;/SPAN&gt;&lt;SPAN&gt;**&lt;/SPAN&gt;&lt;SPAN&gt;create_user_dict&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;SPAN&gt;Send a notification&lt;/SPAN&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV&gt;&lt;SPAN&gt;gis&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;users&lt;/SPAN&gt;&lt;SPAN&gt;.send_notification(username, subject, message, type='email')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Fri, 31 May 2024 23:40:51 GMT</pubDate>
    <dc:creator>rob_hewy</dc:creator>
    <dc:date>2024-05-31T23:40:51Z</dc:date>
    <item>
      <title>'Add members and notify them via email' in Hub through python api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-members-and-notify-them-via-email-in-hub/m-p/1358224#M9388</link>
      <description>&lt;P&gt;Question is essentially the title: is it possible to create accounts using the python api that's a replication of the 'Add members and notify them via email' style used in the GUI (see below)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SFM_TravisBott_0-1701977185873.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/88396iFFE562E283B0A3C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SFM_TravisBott_0-1701977185873.png" alt="SFM_TravisBott_0-1701977185873.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our workflow is going to involve ingesting a list of hundreds of names from a survey, verifying them, and then creating hub community accounts. The preference would be to do so in a way that lets the user set their own password rather than provisioning them one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been able to create users just fine, and then send a notification email just fine, but I don't like how the process is separate and the fact that a notification email comes from&amp;nbsp;&lt;EM&gt;me&lt;/EM&gt;, rather than the ArcGIS Online system. Examples below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Define User
first_name = 'First'
last_name = 'Last'
email = 'First.Last@fake.com'

#Create user
new_user = gis.users.create(
    username = f'{first_name}_{last_name}_Community',
    password = 'testTest123',
    firstname = first_name,
    lastname = last_name,
    email = email,
    credits = 50,
    role = 't8qahvxvKEh6uNyT',
    user_type = 'creatorUT',
    groups = '&amp;lt;987ce15a07694fa6bf9ec45cd6241b7b&amp;gt;'
)

#Send notification
userList = []
userList.append(new_user)
messageSubject = 'This is a test message from AGOL'
messageMessage = 'This is the plain text message that we are sending. Check it out.'

gis.users.send_notification(userList, subject = messageSubject, message = messageMessage, type = 'email')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would seem that just using the .create() method could generate the GUI-style email, as, according to the &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.UserManager.create" target="_self"&gt;documentation&lt;/A&gt;, there's an 'email_text' argument (see below). However, when attempting this I get an error saying that the 'email_text' argument is unexpected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;create&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;username&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;password&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;firstname&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;lastname&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;email&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;role&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;description&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;None&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;provider&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;'arcgis'&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;idp_username&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;None&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;level&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;thumbnail&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;None&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;user_type&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;None&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;credits&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;- 1&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;groups&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;None&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN class=""&gt;email_text&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;None&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;A title="Permalink to this definition" href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.UserManager.create" target="_blank" rel="noopener"&gt;¶&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;emailText = 'This is a test email! You have been invited to join this community extravaganza!'

new_user = gis.users.create(
    username = f'{first_name}_{last_name}_fhsz',
    password = 'testTest123',
    firstname = first_name,
    lastname = last_name,
    email = email,
    credits = 50,
    role = 't8qahvxvKEh6uNyT',
    user_type = 'creatorUT',
    groups = '&amp;lt;987ce15a07694fa6bf9ec45cd6241b7b&amp;gt;',
    email_text = emailText
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SFM_TravisBott_1-1701977912380.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/88400iABB417CA21E775A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SFM_TravisBott_1-1701977912380.png" alt="SFM_TravisBott_1-1701977912380.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated. It would be much better if we could mimic the GUI-style sending of an email, rather than creating the usernames and then sending them an email to try to log in.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 19:41:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-members-and-notify-them-via-email-in-hub/m-p/1358224#M9388</guid>
      <dc:creator>SFM_TravisBott</dc:creator>
      <dc:date>2023-12-07T19:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: 'Add members and notify them via email' in Hub through python api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-members-and-notify-them-via-email-in-hub/m-p/1358237#M9389</link>
      <description>&lt;P&gt;Wonder if you might be using a pre-2.2.0 version of the ArcGIS for Python API, which would not include the&amp;nbsp; email_text parameter? (&lt;A href="https://developers.arcgis.com/python/guide/release-notes-220/" target="_self"&gt;What's new in version 2.2.0?&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 19:58:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-members-and-notify-them-via-email-in-hub/m-p/1358237#M9389</guid>
      <dc:creator>PeterKnoop</dc:creator>
      <dc:date>2023-12-07T19:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: 'Add members and notify them via email' in Hub through python api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-members-and-notify-them-via-email-in-hub/m-p/1360461#M9412</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/374806"&gt;@PeterKnoop&lt;/a&gt;&amp;nbsp;You were right. After faffing through upgrading Pro, getting my python environments switched out (since Pro wouldn't accommodate updating my previous ones), I now have the updated 2.2 version of the arcgis module which allows the email parameter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far it successfully created the account but there's not an email in sight. So I revert to my original question: is something like 'add members and notify via email' possible?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 17:58:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-members-and-notify-them-via-email-in-hub/m-p/1360461#M9412</guid>
      <dc:creator>SFM_TravisBott</dc:creator>
      <dc:date>2023-12-13T17:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: 'Add members and notify them via email' in Hub through python api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-members-and-notify-them-via-email-in-hub/m-p/1481710#M10090</link>
      <description>&lt;P&gt;Did you this to work?&lt;/P&gt;&lt;P&gt;I am using&amp;nbsp;2.3.0.3 and no email is sent.&lt;/P&gt;&lt;P&gt;Is there a setting in the portal that needs to be flipped?&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 23:54:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-members-and-notify-them-via-email-in-hub/m-p/1481710#M10090</guid>
      <dc:creator>rob_hewy</dc:creator>
      <dc:date>2024-05-30T23:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: 'Add members and notify them via email' in Hub through python api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-members-and-notify-them-via-email-in-hub/m-p/1482344#M10093</link>
      <description>&lt;P&gt;What just worked for me was:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create the user&lt;UL&gt;&lt;LI&gt;&lt;DIV&gt;&lt;SPAN&gt;gis&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;users&lt;/SPAN&gt;&lt;SPAN&gt;.create(&lt;/SPAN&gt;&lt;SPAN&gt;**&lt;/SPAN&gt;&lt;SPAN&gt;create_user_dict&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;SPAN&gt;Send a notification&lt;/SPAN&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV&gt;&lt;SPAN&gt;gis&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;users&lt;/SPAN&gt;&lt;SPAN&gt;.send_notification(username, subject, message, type='email')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 31 May 2024 23:40:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-members-and-notify-them-via-email-in-hub/m-p/1482344#M10093</guid>
      <dc:creator>rob_hewy</dc:creator>
      <dc:date>2024-05-31T23:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: 'Add members and notify them via email' in Hub through python api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-members-and-notify-them-via-email-in-hub/m-p/1635116#M11523</link>
      <description>&lt;P&gt;Thank you, Rob - got that to work for me, too!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jul 2025 18:38:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-members-and-notify-them-via-email-in-hub/m-p/1635116#M11523</guid>
      <dc:creator>StephaniePhillips-MG</dc:creator>
      <dc:date>2025-07-22T18:38:48Z</dc:date>
    </item>
  </channel>
</rss>

