hreinart
asked on
Agent (and special view) needed to send out mails
hi,
i need an agent sending out a mail to everyone who appears in my inbox.
idea:
i need a new view, similar to the inbox folder, showing incomming mails.
i don't want to see duplicate sender addresses. so something like "unique" on from / replyto ...or what ever is good to use here.
then i need an agent going from the first mail until to the last mail and create per incomming mail a new mail (regarding the subject: not a real reply).
the agent should do this:
- so imagine looking at your inbox.
- sort it e.g. by date. go to the 1st mail.
- do a reply
- change the subject to "this my special mail"
- put some predefined text (not person specific) into the body
- press send-only
- goto the next mail...and so on
- ....and all this in the special unique view
if this works it would look like this:
- i open a new view or folder
- i see all mails beeing sent to me sofar from all senders
- if a sender writes 3 mails to me, i only see 1 of them
- i press "agent xxx run"
- the agent will create some thousand mails with a spcific subject and body.
anything unclear?
please respond
i need an agent sending out a mail to everyone who appears in my inbox.
idea:
i need a new view, similar to the inbox folder, showing incomming mails.
i don't want to see duplicate sender addresses. so something like "unique" on from / replyto ...or what ever is good to use here.
then i need an agent going from the first mail until to the last mail and create per incomming mail a new mail (regarding the subject: not a real reply).
the agent should do this:
- so imagine looking at your inbox.
- sort it e.g. by date. go to the 1st mail.
- do a reply
- change the subject to "this my special mail"
- put some predefined text (not person specific) into the body
- press send-only
- goto the next mail...and so on
- ....and all this in the special unique view
if this works it would look like this:
- i open a new view or folder
- i see all mails beeing sent to me sofar from all senders
- if a sender writes 3 mails to me, i only see 1 of them
- i press "agent xxx run"
- the agent will create some thousand mails with a spcific subject and body.
anything unclear?
please respond
Forgot the @Unique:
@Unique(@DbColumn("":""; ""; "Your $Inbox"; new_column_number))
@Unique(@DbColumn("":""; ""; "Your $Inbox"; new_column_number))
ASKER
thanks for the quick reply.
there is a barrierer sending out 1 mail to thousands of receipients.
there is a barrierer sending out 1 mail to thousands of receipients.
There's even a better approach maybe (with an agent...). In the mail-database (R6) there is an action Add Recipients\to new Group in Address Book. You could copy this agent and modify it to Add Originators\to new Group in Address Book. Inside the Declaration section there is a function ProcessCandidates(), with 4 times almost identical lines (SendTo, CopyTo, etc). You could modify this one to read
...
If Me.m_noteCandidate.hasitem ("From") And Len(Me.m_noteCandidate.Get ItemValue( "From")(0) ) Then
Me.m_strRecipientArray = Arrayappend(Me.m_strRecipi entArray,A ppendDomai n(Me.m_not eCandidate .GetItemVa lue("SendT o")))
End If
...
Maybe there are even more things to change, but you could test this with only a few mails selected. If you have created the group in your N&A-book, you can put this group into the BCC of your mail.
Good luck!
...
If Me.m_noteCandidate.hasitem
Me.m_strRecipientArray = Arrayappend(Me.m_strRecipi
End If
...
Maybe there are even more things to change, but you could test this with only a few mails selected. If you have created the group in your N&A-book, you can put this group into the BCC of your mail.
Good luck!
Are you talking about sending a message to every person who has ever sent you a message? Or only to those that are currently in your inbox (those that you have not deleted and not moved to a different folder)?
ASKER
sjef_bosman:
i'm using r5, sorry didn't mention it.
i'm looking for a complete solution, i can't program
qwaletee:
i'm laszy .... ;-)
nearly all people who wrote me a mail are (still) in my inbox.
so this would work, if you have something running on this (or duplicate) view.
i'm using r5, sorry didn't mention it.
i'm looking for a complete solution, i can't program
qwaletee:
i'm laszy .... ;-)
nearly all people who wrote me a mail are (still) in my inbox.
so this would work, if you have something running on this (or duplicate) view.
R5? I don't know if I still have that template... same Action is there, probably also the same coding. But if you cannot program, do you have the Notes Designer or what? How do you plan to do the necessary coding?
I tested it for you, and it works just as I described above. Your recipe:
1. View the Design of your mail database
2. go to the Agents
3. make a copy of Add Recipients\to new Group in Address Book
4. name this one Add Senders\...
5. go to Declarations
6. look for the function ProcessCandidates
7. look for the 2 lines with SendTo
8. replace all words SendTo by From
9. throw away 6 lines starting with If Me.m_noteCandidate.hasitem ("CopyTo")
10. save, close, goto Notes, Actions, and click your new Action
You then create a new group in your N&A-book.
I tested it for you, and it works just as I described above. Your recipe:
1. View the Design of your mail database
2. go to the Agents
3. make a copy of Add Recipients\to new Group in Address Book
4. name this one Add Senders\...
5. go to Declarations
6. look for the function ProcessCandidates
7. look for the 2 lines with SendTo
8. replace all words SendTo by From
9. throw away 6 lines starting with If Me.m_noteCandidate.hasitem
10. save, close, goto Notes, Actions, and click your new Action
You then create a new group in your N&A-book.
ASKER
sjef_bosman:
i have a desinger.
if i do all what you tested, what can i do with the new group in my n&a?
ok, i can't do it, but is it really so complicate to write an agent doing:
- go to the 1st document in the view or folder
- create a reply
- change subject to: xxxx
- change body to: yyyy
- send the mail without saving locally
????
i have a desinger.
if i do all what you tested, what can i do with the new group in my n&a?
ok, i can't do it, but is it really so complicate to write an agent doing:
- go to the 1st document in the view or folder
- create a reply
- change subject to: xxxx
- change body to: yyyy
- send the mail without saving locally
????
Okay, you added the agent, did you activate it? It asked you to type the name of a group, and after the OK it created this group for you in you personal N&A Book. Is that right, is there a new group?
If so, you can just write one new mail, name the group in the BCC and press send. That should be all. If you think you have too many names in the group, split it up into several groups and send more mails.
Whether writing an agent is complicated depends on the person you're asking it from. It takes quite some time, which I haven't go (or don't want to spend for free). Helping you is no problem, but I'm not going to lead you all the way. Be a sport, do try it for yourself...
If so, you can just write one new mail, name the group in the BCC and press send. That should be all. If you think you have too many names in the group, split it up into several groups and send more mails.
Whether writing an agent is complicated depends on the person you're asking it from. It takes quite some time, which I haven't go (or don't want to spend for free). Helping you is no problem, but I'm not going to lead you all the way. Be a sport, do try it for yourself...
ASKER
hi,
i wonder why you always reply to the questions and write: i don't have time for it.
if you don't have time, please don't reply.
i need a solution, that's why i ask here...and normally get the needed answers.
splitting up in groups is not what i want.
i don't want to count until (about) 250 recipients and go for the next 250...
i need that solution that creates one mail after the other (or 1 mail with 249 bcc receipients).
nichts für ungut, aber alles andere bringt mir nichts......
i wonder why you always reply to the questions and write: i don't have time for it.
if you don't have time, please don't reply.
i need a solution, that's why i ask here...and normally get the needed answers.
splitting up in groups is not what i want.
i don't want to count until (about) 250 recipients and go for the next 250...
i need that solution that creates one mail after the other (or 1 mail with 249 bcc receipients).
nichts für ungut, aber alles andere bringt mir nichts......
' Agent Add Senders\to new Group in Address Book
Use "Common"
Option Declare
Class AddToGroupStringTable
Function GetString(nIndex As Integer, vData As Variant) As String
Select Case nIndex
Case 1
GetString = "Rename target group"
Case 2
GetString = "Replace existing group with new group"
Case 3
GetString = "Append selected member(s) to existing group member(s)"
Case 4
GetString = "A group by this name is already defined. "
Case 5
GetString = "Please select the desired action"
Case 6
GetString = "Please enter new group name"
Case 7
GetString = "Lotus Notes"
Case 8
GetString = "-Untitled-"
Case 9
GetString = "Add recipients to new group"
End Select
End Function
End Class
Class GroupHelperLauncher As BaseApplication
Private m_GroupHelperStringTable As AddToGroupStringTable
Private m_uiws As notesuiworkspace
Private m_dbLocalAddressBook As notesdatabase
Private m_viewGroup As notesview
Private m_collection As notesdocumentcollection
Private m_noteOptions As notesdocument
Private m_noteCandidate As notesdocument
Private m_noteGroupEntry As notesdocument
Private m_vUserDomain As Variant
Private m_vTrimmedList As Variant
Private m_strRecipientArray As Variant
Private m_nSuccess As Integer
Private m_nEntryNumber As Integer
'//Public Subs and Functions
'//Init//
Sub Init()
Set Me.m_GroupHelperStringTabl e = New AddToGroupStringTable
Set Me.m_collection = GroupHelperLauncher..Docum entsToProc ess
If Not Me.m_collection.count > 0 Then
Exit Sub
End If
Set Me.m_uiws = New notesuiworkspace
Me.m_vUserDomain = Evaluate(|@Domain|)
Set Me.m_dbLocalAddressBook = GroupHelperLauncher..Local AddressBoo k
Set Me.m_noteOptions = Me.m_db.CreateDocument
End Sub
Function ProcessCandidates()
Set Me.m_noteCandidate = Me.m_collection.getfirstdo cument
While Not Me.m_noteCandidate Is Nothing
If Not Isarray(Me.m_strRecipientA rray) Then
Redim Me.m_strRecipientArray(0)
Me.m_strRecipientArray(0) = ""
Else
Me.m_nEntryNumber = Me.m_nEntryNumber + 1
End If
If Me.m_noteCandidate.hasitem ("From") And Len(Me.m_noteCandidate.Get ItemValue( "From")(0) ) Then
Me.m_strRecipientArray = Arrayappend(Me.m_strRecipi entArray,A ppendDomai n(Me.m_not eCandidate .GetItemVa lue("From" )))
End If
Set Me.m_noteCandidate = Me.m_collection.getnextDoc ument(Me.m _noteCandi date)
Wend
Me.m_vTrimmedList = RemoveDuplicates(OptimizeA ddressArra y(Me.m_str RecipientA rray))
Call Me.m_noteOptions.replaceit emvalue("A llAddresse s",Me.m_vT rimmedList )
Me.m_nSuccess = Me.m_uiws.dialogbox("(Grou pHelper)", True,True, False,Fals e,False,Fa lse,_
Me.m_GroupHelperStringTabl e.GetStrin g(9,Null), Me.m_noteO ptions,Tru e,False)
If Me.m_nSuccess Then
Call CreateNABEnrty()
End If
End Function
Private Function AppendDomain(EmailAddessAr ray As Variant) As Variant
If Me.m_noteCandidate.hasitem ("FromDoma in") Then
If Len(Me.m_noteCandidate.Get ItemValue( "FromDomai n")(0)) Then
Dim x As Integer
For x = 0 To Ubound(EmailAddessArray)
If Not EmailAddessArray(x) = "" And Not Isnull(EmailAddessArray(x) ) Then
If Not Me.m_vUserDomain(0) = Me.m_noteCandidate.GetItem Value("Fro mDomain")( 0) Then
EmailAddessArray(x) = EmailAddessArray(x) & "@" & Me.m_noteCandidate.GetItem Value("Fro mDomain")( 0)
End If
End If
Next
End If
End If
AppendDomain = EmailAddessArray
End Function
Private Function OptimizeAddressArray(Email Address As Variant) As Variant
On Error Goto TRAP
If Isarray(EmailAddress) Then
Dim x As Integer
Dim vTempName As Variant
For x = 0 To Ubound(EmailAddress)
If Not EmailAddress(x) = "" Or Not Isnull(EmailAddress(x)) Then
vTempName = Evaluate(|@OptimizeMailAdd ress("| & EmailAddress(x) &|")|)
EmailAddress(x) = vTempName(0)
End If
Next
Else
EmailAddress = Evaluate(|@OptimizeMailAdd ress("| & EmailAddress &|")|)
End If
OptimizeAddressArray = EmailAddress
Exit Function
TRAP:
vTempName(0) = EmailAddress(x)
Resume Next
End Function
Function RemoveDuplicates(strArray As Variant) As Variant
Dim x As Integer
Dim y As Integer
Dim tmpstrArray() As String
Redim tmpstrArray(0)
For x = 0 To Ubound(strArray)
If Isnull(Arraygetindex(tmpst rArray,str Array(x),1 )) Then
tmpstrArray(y) = strArray(x)
y = y+1
Redim Preserve tmpstrArray(y)
End If
Next
RemoveDuplicates = Fulltrim(tmpstrArray)
End Function
Function CreateNABEnrty()
Set Me.m_viewGroup = Me.m_dbLocalAddressBook.Ge tView("($P eopleGroup sFlat)")
Set Me.m_noteGroupEntry = Me.m_viewGroup.Getdocument bykey(Me.m _noteOptio ns.GroupNa me(0),True )
If Me.m_noteGroupEntry Is Nothing Then
'// this is a new group and we'll just populate it
Set Me.m_noteGroupEntry = Me.m_dbLocalAddressBook.cr eatedocume nt
With Me.m_noteGroupEntry
Call .replaceitemvalue("Form"," Group")
Call .replaceitemvalue("Type"," Group")
Call .replaceitemvalue("ListNam e",Me.m_no teOptions. GetItemVal ue("GroupN ame"))
Call .replaceitemvalue("GroupTy pe",Me.m_n oteOptions .GetItemVa lue("Group Type"))
Call .replaceitemvalue("ListDes cription", Me.m_noteOptions.GetItemVa lue("Descr iption"))
Call .replaceitemvalue("Members ", Me.m_noteOptions.GetItemVa lue("Selec tedGroupMe mbers"))
Call .save(True,True,True)
End With
Else
'// this group is already in the NAB, so lets see what they want to do!
Dim Options(2) As String
Dim strResponse As String
Options(0) = Me.m_GroupHelperStringTabl e.GetStrin g(1,Null)
Options(1) = Me.m_GroupHelperStringTabl e.GetStrin g(2,Null)
Options(2) = Me.m_GroupHelperStringTabl e.GetStrin g(3,Null)
strResponse = Me.m_uiws.Prompt(prompt_ok cancellist ,_
Me.m_GroupHelperStringTabl e.GetStrin g(7,Null), _
Me.m_GroupHelperStringTabl e.GetStrin g(4,Null) & Chr(13) & _
Me.m_GroupHelperStringTabl e.GetStrin g(5,Null), _
Options(0), Options)
Select Case strResponse
Case Options(0)
'get new group string name from user
Dim strtmpGroupString As String
strtmpGroupString = Inputbox(Me.m_GroupHelperS tringTable .GetString (6,Null),_
Me.m_GroupHelperStringTabl e.GetStrin g(7,Null), _
Me.m_GroupHelperStringTabl e.GetStrin g(8,Null))
Call Me.m_noteOptions.replaceit emvalue("G roupName", strtmpGrou pString)
Call CreateNABEnrty()
Case Options(1)
'replace the members
With Me.m_noteGroupEntry
Call .replaceitemvalue("GroupTy pe",Me.m_n oteOptions .GetItemVa lue("Group Type"))
Call .replaceitemvalue("Members ", Me.m_noteOptions.GetItemVa lue("Selec tedGroupMe mbers"))
Call .save(True,True,True)
End With
Case Options(2)
'append the members to the list (check for unique entries)
With Me.m_noteGroupEntry
Call Me.m_noteOptions.ReplaceIt emValue("S electedGro upMembers" ,_
RemoveDuplicates(OptimizeA ddressArra y(Arrayapp end(Me.m_n oteOptions .GetItemVa lue("Selec tedGroupMe mbers"),_
.GetItemValue("Members"))) ))
Call .replaceitemvalue("Members ", Me.m_noteOptions.GetItemVa lue("Selec tedGroupMe mbers"))
Call .save(True,True,True)
End With
End Select
End If
End Function
End Class
Sub Initialize
Dim copyfunction As New GroupHelperLauncher
Call copyfunction.init()
Call copyfunction.ProcessCandid ates()
End Sub
' Und jetzt genügt's, ich werde nie wieder reagieren auf so eine Frage
Use "Common"
Option Declare
Class AddToGroupStringTable
Function GetString(nIndex As Integer, vData As Variant) As String
Select Case nIndex
Case 1
GetString = "Rename target group"
Case 2
GetString = "Replace existing group with new group"
Case 3
GetString = "Append selected member(s) to existing group member(s)"
Case 4
GetString = "A group by this name is already defined. "
Case 5
GetString = "Please select the desired action"
Case 6
GetString = "Please enter new group name"
Case 7
GetString = "Lotus Notes"
Case 8
GetString = "-Untitled-"
Case 9
GetString = "Add recipients to new group"
End Select
End Function
End Class
Class GroupHelperLauncher As BaseApplication
Private m_GroupHelperStringTable As AddToGroupStringTable
Private m_uiws As notesuiworkspace
Private m_dbLocalAddressBook As notesdatabase
Private m_viewGroup As notesview
Private m_collection As notesdocumentcollection
Private m_noteOptions As notesdocument
Private m_noteCandidate As notesdocument
Private m_noteGroupEntry As notesdocument
Private m_vUserDomain As Variant
Private m_vTrimmedList As Variant
Private m_strRecipientArray As Variant
Private m_nSuccess As Integer
Private m_nEntryNumber As Integer
'//Public Subs and Functions
'//Init//
Sub Init()
Set Me.m_GroupHelperStringTabl
Set Me.m_collection = GroupHelperLauncher..Docum
If Not Me.m_collection.count > 0 Then
Exit Sub
End If
Set Me.m_uiws = New notesuiworkspace
Me.m_vUserDomain = Evaluate(|@Domain|)
Set Me.m_dbLocalAddressBook = GroupHelperLauncher..Local
Set Me.m_noteOptions = Me.m_db.CreateDocument
End Sub
Function ProcessCandidates()
Set Me.m_noteCandidate = Me.m_collection.getfirstdo
While Not Me.m_noteCandidate Is Nothing
If Not Isarray(Me.m_strRecipientA
Redim Me.m_strRecipientArray(0)
Me.m_strRecipientArray(0) = ""
Else
Me.m_nEntryNumber = Me.m_nEntryNumber + 1
End If
If Me.m_noteCandidate.hasitem
Me.m_strRecipientArray = Arrayappend(Me.m_strRecipi
End If
Set Me.m_noteCandidate = Me.m_collection.getnextDoc
Wend
Me.m_vTrimmedList = RemoveDuplicates(OptimizeA
Call Me.m_noteOptions.replaceit
Me.m_nSuccess = Me.m_uiws.dialogbox("(Grou
Me.m_GroupHelperStringTabl
If Me.m_nSuccess Then
Call CreateNABEnrty()
End If
End Function
Private Function AppendDomain(EmailAddessAr
If Me.m_noteCandidate.hasitem
If Len(Me.m_noteCandidate.Get
Dim x As Integer
For x = 0 To Ubound(EmailAddessArray)
If Not EmailAddessArray(x) = "" And Not Isnull(EmailAddessArray(x)
If Not Me.m_vUserDomain(0) = Me.m_noteCandidate.GetItem
EmailAddessArray(x) = EmailAddessArray(x) & "@" & Me.m_noteCandidate.GetItem
End If
End If
Next
End If
End If
AppendDomain = EmailAddessArray
End Function
Private Function OptimizeAddressArray(Email
On Error Goto TRAP
If Isarray(EmailAddress) Then
Dim x As Integer
Dim vTempName As Variant
For x = 0 To Ubound(EmailAddress)
If Not EmailAddress(x) = "" Or Not Isnull(EmailAddress(x)) Then
vTempName = Evaluate(|@OptimizeMailAdd
EmailAddress(x) = vTempName(0)
End If
Next
Else
EmailAddress = Evaluate(|@OptimizeMailAdd
End If
OptimizeAddressArray = EmailAddress
Exit Function
TRAP:
vTempName(0) = EmailAddress(x)
Resume Next
End Function
Function RemoveDuplicates(strArray As Variant) As Variant
Dim x As Integer
Dim y As Integer
Dim tmpstrArray() As String
Redim tmpstrArray(0)
For x = 0 To Ubound(strArray)
If Isnull(Arraygetindex(tmpst
tmpstrArray(y) = strArray(x)
y = y+1
Redim Preserve tmpstrArray(y)
End If
Next
RemoveDuplicates = Fulltrim(tmpstrArray)
End Function
Function CreateNABEnrty()
Set Me.m_viewGroup = Me.m_dbLocalAddressBook.Ge
Set Me.m_noteGroupEntry = Me.m_viewGroup.Getdocument
If Me.m_noteGroupEntry Is Nothing Then
'// this is a new group and we'll just populate it
Set Me.m_noteGroupEntry = Me.m_dbLocalAddressBook.cr
With Me.m_noteGroupEntry
Call .replaceitemvalue("Form","
Call .replaceitemvalue("Type","
Call .replaceitemvalue("ListNam
Call .replaceitemvalue("GroupTy
Call .replaceitemvalue("ListDes
Call .replaceitemvalue("Members
Call .save(True,True,True)
End With
Else
'// this group is already in the NAB, so lets see what they want to do!
Dim Options(2) As String
Dim strResponse As String
Options(0) = Me.m_GroupHelperStringTabl
Options(1) = Me.m_GroupHelperStringTabl
Options(2) = Me.m_GroupHelperStringTabl
strResponse = Me.m_uiws.Prompt(prompt_ok
Me.m_GroupHelperStringTabl
Me.m_GroupHelperStringTabl
Me.m_GroupHelperStringTabl
Options(0), Options)
Select Case strResponse
Case Options(0)
'get new group string name from user
Dim strtmpGroupString As String
strtmpGroupString = Inputbox(Me.m_GroupHelperS
Me.m_GroupHelperStringTabl
Me.m_GroupHelperStringTabl
Call Me.m_noteOptions.replaceit
Call CreateNABEnrty()
Case Options(1)
'replace the members
With Me.m_noteGroupEntry
Call .replaceitemvalue("GroupTy
Call .replaceitemvalue("Members
Call .save(True,True,True)
End With
Case Options(2)
'append the members to the list (check for unique entries)
With Me.m_noteGroupEntry
Call Me.m_noteOptions.ReplaceIt
RemoveDuplicates(OptimizeA
.GetItemValue("Members")))
Call .replaceitemvalue("Members
Call .save(True,True,True)
End With
End Select
End If
End Function
End Class
Sub Initialize
Dim copyfunction As New GroupHelperLauncher
Call copyfunction.init()
Call copyfunction.ProcessCandid
End Sub
' Und jetzt genügt's, ich werde nie wieder reagieren auf so eine Frage
ASKER
ups.. looks interesting, thanks sofar.
it'd be nice if you could give me some (even short) comments) where to insert this.
will this agent work like i asked?
i'll have to try it out.
thanks
hreinart
it'd be nice if you could give me some (even short) comments) where to insert this.
will this agent work like i asked?
i'll have to try it out.
thanks
hreinart
ASKER
sjef_bosman:
hi,
i don't understand what you wrote.
could you please put it in a database and mail it to:
nospamforhreinart@onlineho me.de
this account will work about 1 pm 11-03-2003
thanks
hreinart
hi,
i don't understand what you wrote.
could you please put it in a database and mail it to:
nospamforhreinart@onlineho
this account will work about 1 pm 11-03-2003
thanks
hreinart
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@DbColumn("":""; ""; "Your $Inbox"; new_column_number)