 |
|
| View previous topic :: View next topic |
| Author |
Message |
devicode Site Admin
Joined: 05 Mar 2005 Posts: 248
|
Posted: Mon Jan 14, 2008 10:30 pm Post subject: Extract First Name, Last Name and Email address |
|
|
How to set up the “Incoming Email Data Extractor” in response mailer pro for these fields?
1. First Name, 2. Last Name, 3. Email
The email body contains:
Name: Shawn Miller
Address: 12 S. 2th Ave
City: Long Beach
Phone: (123) 456-7890
Email: miller@someplace.com |
|
| Back to top |
|
 |
devicode Site Admin
Joined: 05 Mar 2005 Posts: 248
|
Posted: Mon Jan 14, 2008 10:50 pm Post subject: |
|
|
- Add 'Extractor Data from incoming Email'
Field Name : Extracted_Name
Email Data Source : Message body
# Start of Data Field'
For the FROM select 'Specific text'
For the TEXT enter Name:
# 'End of Data Field'
For the TO select 'End of line'
- Add 'Run Script to modify Extracted Data'
Field Name : EXT_FirstName
Start Value : [[Extracted_Name]]
Enter the following in the VB Script box
| Code: | ' VBScript
' You can create any number of new Sub Procedures and Functions.
Sub Main()
' commands start here
Extracted_Name.value = PCase( Extracted_Name.value)
EXT_FirstName.value = GetWord( Extracted_Name.value, 0 )
End Sub
Function GetWord(byVal string, Index)
Dim Words, c
If IsNull(string) Then
GetWord = Null
Exit Function
Else
string = CStr( string )
End If
Words = Split( string, " " )
c = UBound(Words)
If Index <0 or Index>= c Then
Index = Cint (c)
End If
GetWord = Trim( Words (Index) )
End Function
Function PCase(byVal string)
Dim Tmp, Word, Tmp1, Tmp2, firstCt, a, sentence, c, i
If IsNull(string) Then
PCase = Null
Exit Function
Else
string = CStr( string )
End If
a = Split( string, vbCrLf )
c = UBound(a)
i = 0
For each sentence in a
Tmp = Trim( sentence )
Tmp = split( sentence, " " )
For Each Word In Tmp
Word = Trim( Word )
Tmp1 = UCase( Left( Word, 1 ) )
Tmp2 = LCase( Mid( Word, 2 ) )
PCase = PCase & Tmp1 & tmp2 & " "
Next
PCase = Left( PCase, Len(PCase) - 1 )
If i = c then
Else
PCase = PCase & vbCrLf
End If
i = i + 1
Next
End Function
|
- Add 'Run Script to modify Extracted Data'
Field Name : EXT_LastName
Start Value : [[Extracted_Name]]
Enter the following in the VB Script box
| Code: | ' VBScript
' You can create any number of new Sub Procedures and Functions.
Sub Main()
' commands start here
Extracted_Name.value = PCase( Extracted_Name.value)
EXT_LastName.value = GetWord( Extracted_Name.value, 4 )
End Sub
Function GetWord(byVal string, Index)
Dim Words, c
If IsNull(string) Then
GetWord = Null
Exit Function
Else
string = CStr( string )
End If
Words = Split( string, " " )
c = UBound(Words)
If Index <0 or Index>= c Then
Index = Cint (c)
End If
GetWord = Trim( Words (Index) )
End Function
Function PCase(byVal string)
Dim Tmp, Word, Tmp1, Tmp2, firstCt, a, sentence, c, i
If IsNull(string) Then
PCase = Null
Exit Function
Else
string = CStr( string )
End If
a = Split( string, vbCrLf )
c = UBound(a)
i = 0
For each sentence in a
Tmp = Trim( sentence )
Tmp = split( sentence, " " )
For Each Word In Tmp
Word = Trim( Word )
Tmp1 = UCase( Left( Word, 1 ) )
Tmp2 = LCase( Mid( Word, 2 ) )
PCase = PCase & Tmp1 & tmp2 & " "
Next
PCase = Left( PCase, Len(PCase) - 1 )
If i = c then
Else
PCase = PCase & vbCrLf
End If
i = i + 1
Next
End Function |
- Add 'Extractor Data from incoming Email'
Field Name : Extracted_Email
Email Data Source : Message body
# Start of Data Field'
For the FROM select 'Specific text'
For the TEXT enter Email:
# 'End of Data Field'
For the TO select 'End of line'
You can now use
[[EXT_FirstName]], [[EXT_LastName]], [[Extracted_Email]] in your autorepy emails. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|