0 votes

Hi!

Is it possible to set the initiator &/ the created user (when doing a user creation) as the sending email adress for a outgoing email from Adaxess?

The use case is that we want to submit tickets to our helpdesk (Jira Servicedesk) and both have them come from the right person and when its a new user, get auto creation of the user account from AdAxess by means of the email thats beeing sent.

Currently its sent from the fixed from address thats setup in settings for the server.

/Kaj

by (650 points)
0

Did search a bit and found Automate an email based on anniversary/birthdate.

Modified it a bit, would this work as a run a powershell script?
The question is if the created users email adress is in the %mail% variable?

$to = "Jira" # TODO: modify me
$smtpServer = "mail.domain.com" # TODO: modify me
$subject = "New user creation" # TODO: modify me
$from = "%mail%" # TODO: modify me
$htmlMessage = "<b>Edit this user to show real name</b><br>And then close the case" # TODO: modify me

if ($from -eq $NULL)
{
    $Context.LogMessage("The email address for the %mail% is not specified", "Warning")
    return
}

# Send mail
Send-MailMessage -To $to -From $from -SmtpServer $smtpServer -Body $htmlMessage -BodyAsHtml -Subject $subject

1 Answer

0 votes
by (289k points)
selected by
Best answer

Hello Kaj,

The condition if ($from -eq $NULL) will not work because it is checking a string for being empty. You need to use the following code instead:

if ([System.String]::IsNullOrEmpty($from))

Also, as we can see, the log message that will be added to the execution log contains the %mail% value reference. It will always resolve into an empty value as the message is added only when the target user has no email address. Most probably, you wanted to add the user Full Name to the message. In this case, you need to use value reference %fullname%.

The rest of the script looks correct and should work just fine.

Related questions

0 votes
1 answer

Is this possible? Example: User A executes a task in Adaxes. That task triggers a mail to another user. That mail needs to have User A as a reply adress.

asked Jun 21, 2019 by kjesoo (960 points)
0 votes
1 answer

Hello, i have a custom command which sets the oof-message for the selected user. in this custom command i have a parameter "param-vertretung" (ad-object picker). Now i want to ... and email of the stand-in in the oof-message. Can you help me with that? Thanks

asked Nov 13, 2020 by lohnag (160 points)
0 votes
1 answer

We have a process that when a new user is created they are emailed their username and apssword. If the user is in an Admin Group they are then sent an email with some PDFs ... you can send emails, but am unable to see where it could attach files to the email?

asked Sep 3, 2020 by dknapp (100 points)
0 votes
1 answer

Is there a way to get an email alert before the Adaxes lisense expires? Ex.: our license expires 13.09.2025 and would like an alert to be sent 14 days before this date.

asked Oct 18 by Handernye (100 points)
0 votes
1 answer

I'd like to know how many versions of Adaxes are there with the patches/updates of every version and how often do they receive the updates. In addition of how often the major upgrades occur?

asked Jan 16 by farid.r (20 points)
3,552 questions
3,242 answers
8,243 comments
547,829 users