|
POST
|
Here's the function I use for sending emails (Python 3). def sendEmail(subject="", body_content="", to=[], cc=[], bcc=[], from_addr="[email protected]"):
"""Send a plain text email.
Required imports:
from email.message import EmailMessage # for a text/plain email message
import smtplib # for sending email
:param str subject: Subject line of email.
:param str body_content: Main message in the body of the email.
:param list to: A list of email addresses as strings for sending the email to.
:param list cc: A list of email addresses as strings for CC'ing the email.
:param list bcc: A list of email addresses as strings for BCC'ing the email.
:param str from_addr: The email address from which to send the email.
:return: All email addresses that received the email (to, cc, bcc).
:rtype: Dictionary
"""
from email.message import EmailMessage
import smtplib
# Validate email recipient args
for recipient in [to, cc, bcc]:
if not isinstance(recipient, list):
raise TypeError(f"Recipients (to, cc, bcc) must each be a list of strings; not {type(recipient)}")
# Create email message object and content.
msg = EmailMessage()
msg.set_content(body_content)
# Set recipients
msg["Subject"] = subject
msg["From"] = from_addr
msg["To"] = ", ".join(to)
msg["Cc"] = ", ".join(cc)
msg["Bcc"] = ", ".join(bcc)
# Send the message via our own SMTP server.
with smtplib.SMTP("mymailserver.domain") as smtp:
smtp.send_message(msg)
# Confirmation messaging.
recipients = {"to": to, "cc": cc, "bcc": bcc}
print(f"sendEmail() successful for recipients {recipients}")
return recipients
... View more
01-26-2024
08:36 AM
|
1
|
0
|
12219
|
|
POST
|
I just ignore that temp path for the sde connection file. Use the workspace properties to inspect the connection, find the appropriate dictionary key by comparing connection properties (not file path), and then update the connection properties from there. For example, my common use is updating the database instance from test to production. You would be looking up the connection properties from your dictionary connections rather than hard coding the value, but you would still update the connection properties similarly. for layer in map.listLayers():
if layer.supports("connectionProperties"):
cp = layer.connectionProperties
for key, value in cp["connection_info"].items():
cp["connection_info"][key] = value.replace("testInstance", "prodInstance")
layer.updateConnectionProperties(layer.connectionProperties, cp)
... View more
01-23-2024
07:46 AM
|
1
|
1
|
1497
|
|
POST
|
Ah, yes, good point! You would probably have to leverage the await operator.
... View more
01-18-2024
02:06 PM
|
0
|
0
|
3005
|
|
POST
|
Are you sure they're in the right order when read into list_address and params?
... View more
01-18-2024
01:59 PM
|
0
|
1
|
3009
|
|
POST
|
Is the order based on a sorting definition for a particular field or set of fields? If not, you would have to reference the original order and copy each geocode row out individually in the order you want.
... View more
01-18-2024
11:58 AM
|
0
|
3
|
3055
|
|
POST
|
I don't think this is possible. ArcGIS Pro Get Active Layer - Esri Community Maybe you can make a Python toolbox with a multivalue parameter and the user can select the layers there?
... View more
01-17-2024
03:54 PM
|
0
|
1
|
1765
|
|
POST
|
@vijaybadugu wrote: I am developing a new production web application for a department. do I need to use any framework or develop simply using legacy JavaScript development (AMD) did for 3.X? No frameworks are necessary. You can develop everything in your JavaScript Maps SDK 4.x app with plain, vanilla JavaScript. Although Esri notes on building with AMD: For new projects integrating the API into third party frameworks or build tools we recommend using local builds with @arcgis/core ES modules. You should build with ES Modules. Apparently esri-loader will be going away with the next release (4.29). heads up: esri-loader is deprecated in 4.29 of the... - Esri Community
... View more
01-17-2024
09:33 AM
|
1
|
0
|
5962
|
|
POST
|
I can't think of how this (with variable lengths) would fit into any parameter data type besides GPString. Does that work?
... View more
01-16-2024
07:15 AM
|
1
|
0
|
1658
|
|
POST
|
This reminds me of the struggles people have with their HOA and local code enforcement authorities during events like No Mow May. Changing public perception about the nature of your landscape is a big hurdle. You might be interested in reading Nature's Best Hope, by Douglas W. Tallamy.
... View more
01-11-2024
02:26 PM
|
0
|
0
|
2700
|
|
POST
|
Human development of almost every kind has a direct, negative impact on climate change. It might be good to clarify that just because you're focusing on HOAs, that is only one of many developments that should be evaluated. Your hypothesis is focused on HOAs, but you are describing how you would survey home owners, which seems like it would kind of change the focus. If you were to somehow gather HOA development and landscape requirements as set forth by the city or county, it might be better to analyze the effect of those requirements on climate change. Or maybe how many or how much of the HOA developments actually align with those requirements as built. You can still use geographic methods (GIS) to analyze current land use and land cover of HOAs to quantify adherence to city/county ordinance. This would also prevent you from having to go door to door, which is time consuming (and possibly dangerous). Depending on the "climate awareness" level of the local ordinances, you could do some analysis to demonstrate what it would take (and what it would look like) for the HOA development ordinance to actually have a positive (or maybe less negative) impact on climate and the environment. In other words, find a way to make your research actionable! You could present your findings to your local government in an effort to initiate change. Personally, I have a strong appreciation for anything that increases awareness and education for planting native. I love the idea that you are attempting to demonstrate the shortcomings of "traditional" HOA development and propose a new standard way of thinking, like planting native grasses (and trees, shrubs, and groundcover). Golf courses are also notorious for their negative environmental impact, so there's another possible target for your research.
... View more
01-11-2024
08:42 AM
|
1
|
3
|
2738
|
|
POST
|
I can't find the documentation, but I recall that ArcGIS Pro does not store the raw path to SDE connections like ArcMap did. The "strange temp directory" is the best you're going to get.
... View more
01-11-2024
07:29 AM
|
0
|
0
|
1656
|
|
POST
|
I use Describe catalogPath and I'm able to build a path to a different feature class in that workspace. What isn't working?
... View more
01-11-2024
07:12 AM
|
0
|
2
|
1660
|
|
POST
|
I've used cx_Oracle, now pyhton-oracledb, to do SQL specific stuff. You could use PL/SQL insert statements into your db table. You might even be able to use an arcpy insert cursor, worth a try. There's also ArcSDESQLExecute, which may or may not work.
... View more
01-09-2024
06:00 AM
|
1
|
0
|
1209
|
|
POST
|
@StuartMoore wrote: i'm using it in an python toolbox in arc catalog What are the parameters in the toolbox?
... View more
01-08-2024
11:13 AM
|
0
|
1
|
2048
|
|
BLOG
|
This is a fun idea. Congrats to everyone who made the Esri Community successful in 2023!
... View more
01-08-2024
11:07 AM
|
3
|
0
|
3495
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 10-23-2025 03:53 PM | |
| 1 | 04-28-2026 07:25 AM | |
| 1 | 03-19-2026 08:59 AM | |
| 1 | 02-12-2026 01:37 PM |