Solved

how to send mail to default user - a custom role

Posted on 2004-04-26
8
249 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

861 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

22 Experts available now in Live!

Get 1:1 Help Now