Solved

how to send mail to default user - a custom role

Posted on 2004-04-26
8
247 Views
Last Modified: 2013-12-18
Hi all,
Several custom roles are created in the ACL.
Now we would like to email to several default
such roles in our app. How should it be be done
so that this is possible?
thanks.

0
Comment
Question by:damoncwk
  • 3
  • 2
8 Comments
 
LVL 15

Accepted Solution

by:
Bozzie4 earned 63 total points
ID: 10917549
The easiest way to solve this, is not add people directly to your ACL, but put them in groups first, and assign the roles to the groups.  This has the added advantage, that you can give people the right to grant access to other people without giving them Manager access in your database (they only need to have Author access on the names.nsf, and listed in the Administrators field for the particular group).

Normally, I use a simple naming scheme, for instance <application name>_<role>_<general access> (create your own naming schemes as you see fit, of course).

For a group in the AnApplication application, that has the Revisor role, and has Author access in the database, I would name it
AnApplication_Revisor_Author

Users can then mail this group, to reach everybody who has the Revisor role


Other solutions require writing a lotusscript, to examine all entries in the ACL, and sending the emails based on those results....

cheers,

Tom
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 10921471
Dim s as new notesSession
Dim db as notesDatabase
Set db = s.currentDatabase
Dim addr as string
Dim acl as notesAcl
Set acl = db.acl
Dim entry as notesAclEntry
Set entry = acl.getFirstEntry
Do Until entry is nothing
    if entry.isRoleEnabled(  "[" & NAME_OF_ROLE & "]"   ) then
        addr = addr & entry.name & ","
    end if
    Set entry = acl.getNextEntry(entry)
Loop

Dim msg as notesDocument
Set msg = db.createDocument
msg.replaceItemValue "Form" , "Memo"
msg.replaceItemValue "Subject" , "something"
msg.replaceItemValue "Body" , "main message" 'you might want to switch to rich text
msg.replaceItemValue "SendTo" , addr
Dim filler
filler = Evaluate(|
FIELD SendTo := @Explode(SendTo;",");
CONTNUE
|,msg)
msg.send false
0
 

Author Comment

by:damoncwk
ID: 10924165
qwaletee,
for your script i tried to add the following
FIELD CopyTo :=@Explode(CopyTo;",");
in order to send cc mail.
However the person specified in the form field "CopyTo" did
not receive any mail after this.

I can mail to the cc mail if I use formula however for your script
I cannot accomplish this part in addition to your comment. Thanks.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 31

Assisted Solution

by:qwaletee
qwaletee earned 62 total points
ID: 10933491
the reasib I had the FIELD SendTo... stuff is as follows:

As I process the ACL, I build a string called ADDR that contains multiple names separated with commas.  It looks sort of like a regular Notes memo recipient list:
damoncwk,bozzie4,qwaletee

But ADDR, is only a LotusScript variable, I need it on the form, so I use:

msg.replaceItemValue "SendTo" , addr

Now, here comes a small problem.  Even though in a memo, it looks like the names are a single string separated by commas, it doesn't really work this way.  they are multiple separate values, known as a list (simialr to arrays), and the list DISPLAYS its multiple values separate dby commas.  Here, we are actually using a single string, not a list field, and Notes will think it is one e-Mail address that has two commas in the middle, not three separate e-mail addresses.

So, I need to find a way to break the string at the commas into a list.  The @Explode formula does that.

You tried to add an @Explode formula for CopyTo.  But yo weren't aware of the mechanisc of why I did the explode.  Since I assigned SendTo to start with, the @Explode had a value to work on.  You didn't assign a CopyTo value (via ReplaceItemValue), so there was a blank string.  The fact that YOUR form contained a CopyTo field is irrelevant because I am not sending your form's data.  I am not even looking at it.

So, you need something like:

msg.replaceItemValue "CopyTo" , "some address"

And if the value you put in is a single address, you won't need an @Explode for it either.  Only bother with @Explode if you put in something like:
msg.replaceItemValue "CopyTo" , "some address,another address"
0
 

Author Comment

by:damoncwk
ID: 10937615
Hi qwaletee,
still digesting your reply.
And how can I include a doclink in the msg?
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 11417646
This is abandoned.  However, I noticed that I never answered the "extra credit" question at the end, so here goes...

Replace:
msg.replaceItemValue "Body" , "main message" 'you might want to switch to rich text

With:
Dim doc as notesDocument
Set doc = s.documentContext
'just an example... you need to set doc to some Notes document, you might also try dim ws as new notesUiWorkspace : Set doc = ws.currentDocument.document
Dim body as new notesRichTextItem ( msg )
msg.appendText "main message" 'you might want to switch to rich text
msg.addNewLine 2
msg.appendDocLink doc "Link text" 'replace this too

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the fileā€¦
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now