Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Sending mail based on the user logged in


This topic is 5986 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I'm using the send mail script step to send messages. I have some user accounts created where each user can only edit certain fields. When they are done I want them to click on a send e-mail button that I've created so that it sends a message to the next person in line. For sake of shortness, I'll just say the users are A, B, C, and D.

What I'm wondering is how do I write my script so that if account A is logged in and clicks the button, a message will be sent to C, but if B logs in and clicks the button it will send to D?

Posted

If [ currentuser = A ]

Send Mail [ to: C ]

Else If [ current user = B ]

Send Mail [ to: d ]

End If

There are other ways* to do it, but this is the most explicit.

*The conditional could be in the To: calculation of the Send Mail script step, thus reducing it to one step.

Posted (edited)

Will I need to set up a separate table that lists all the users and their e-mail addresses so that it will work? How do I go about setting it up so that it knows which account is logged in? Here's the thought that's currently running through my head:

If I set up a table that in one column lists the usernames and a second column that lists their corresponding e-mail addresses it would look like this for example, and call the table currentuser:

jdoe johndoe @123.com

doej janedoe @123.com

So when I set up the If statement you provided, is there something else I need to do so that (hopefully I word this right) when the script is ran it knows which account is logged in and uses the information from that table, or does it just do it automatically so that:

If (currentuser = jdoe)

Send Mail (to = doej)

What is happening at the moment is that since there currently isn't a table called currentuser, I end up receiving an error that the specified table couldn't be found.

Edited by Guest
Posted

I got it to work. I ended up replacing the currentuser with Get(AccountName) and set it up so that

If[Get(AccountName)="A"]

Send Mail[To: "email address"

and so on and so forth, for the remaining accounts.

Thanks for your help.

This topic is 5986 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.