Results 1 to 12 of 12
  1. #1
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199

    Follow Up Email

    I am having a table from where email is send to customers, and update the table as response send as true if customer replies back,



    I need to set up a followup email when ever customer didn't replied in 5 days, on replying upon previous email, could this is possible in VBA?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Probably. Open a recordset in VBA of records that don't have response. Loop through the recordset, send email.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    yes, i want to have a followup email setup for it as a trail mail along with the previously send email.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    So what do you need to know? Do you already have code for sending emails?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    yes, i do have code for it, but my main challenge is a trail mail, where i want to add followup content on previously sent email, as not with the new one again.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    What method are you using to send email? Show code.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    This is the code


    Public Sub WordXPort()

    'CREATING PDF FILES FOR ATTACH AND MAIL DRAFT-START

    Dim rs As DAO.Recordset
    Dim rs1 As DAO.Recordset
    Dim rs2 As DAO.Recordset
    Dim fld3 As Field
    Dim strMessage1 As String
    Dim strMessage As String
    Dim str1 As String
    Dim ctr1 As Integer
    Dim str3 As String
    Dim table As Object
    Dim oLook As Object
    Dim oMail As Object
    Dim i As Integer
    Dim counter As Integer
    Dim Count As Long
    Dim Progress_Amount As Integer
    Dim strTableBeg As String
    Dim strTableEnd As String
    Dim strFntNormal As String
    Dim strFntHeader As String
    Dim strFntEnd As String
    Dim a As Hyperlink



    'intialsing counters
    mlcount = 0
    Count = DCount("order_number", "Redemption_Report")

    'Storing column values to field variables
    Set rs = CurrentDb.OpenRecordset("select * from Redemption_Report")
    Do Until rs.EOF
    Set fld3 = rs.Fields("order_number")
    SysCmd acSysCmdInitMeter, "Files getting generated ...", Count
    For Progress_Amount = 1 To Count
    SysCmd acSysCmdUpdateMeter, Progress_Amount
    'Opening Word Application to add contents
    Set rs1 = CurrentDb.OpenRecordset("select DISTINCT Tracking_No from Master_Table where order_number= " & fld3 & " And emailsent_Date is Null")

    Set rs2 = CurrentDb.OpenRecordset("select * from Email_Status where order_number= " & fld3 & " And email_sent = False")

    'Define format for output
    strTableBeg = "<HTML><table style='border:1px solid black;border-collapse:collapse'>"
    strTableEnd = "</table></HTML>"
    strFntHeader = "<font size=2 face=" & Chr(34) & "Calibri" & Chr(34) & "><b>" & _
    "<tr>" & _
    "<td style='border:1px solid black;text-align:center;'>AWB</td>" & _
    "</tr></b></font>"
    strFntNormal = "<font size = 12 color=black face=" & Chr(34) & "Calibri" & Chr(34) & " size=3.5>"
    strFntEnd = "</font>"
    strMessage = strTableBeg & strFntNormal & strFntHeader
    Do Until rs1.EOF
    strMessage = strMessage & _
    "<tr>" & _
    "<td style='border:1px solid black;text-align:center;'>" & rs1![Tracking_No] & "</td>" & _
    "</tr>"
    rs1.MoveNext
    Loop

    strMessage = strMessage & strFntEnd & strTableEnd
    str1 = "Dear " & rs![contact_first_name] & " " & rs![contact_last_name] & "," & "<br><br>" & _
    "Thank you for placing your order " & rs![order_number] & " with I ovider." & "<br><br>" & _
    "Please note that we have dispatched " & rs![quantity] & "Gift Card(s) to the below mentioned address via <a href=""http://www.aramex.com/"">Aramex</a> with the given AWB number"
    str3 = "Address: " & rs![bizname] & "<br>" & " " & rs![delivery_address_1] & "<br>" & " " & rs![delivery_address_2] & "<br>" & " " & rs![delivery_address_3] & "<br>" & " " & rs![delivery_town] & ", " & rs![delivery_postcode] & "<br>" & " " & rs![delivery_county] & "<br><br>" & _
    "Kindly confirm via return email once you are in receipt of these cards in order for us to activate the card(s) with the ordered amount" & "<br><br>" & _
    "If you have any other questions about any aspect of your order or your account, please quote your order number and business ID and send an email to asdad@i.com." & "<br>" & _
    "Alternatively, you may complete the online " & Chr(34) & "Contact Us" & Chr(34) & " form from your account pages." & "<br><br>" & _
    "Kind Regards" & "<br>" & "logy Provider Points Team" & "<br><br>" & _
    "<IMG alt='' hspace=0 src='cid:MyPic.jpg' align=baseline border=0>"

    'OPENING OUTLOOK AND GENERATING MAIL CONTENT WITH ATTACHMENT-START
    Set oLook = CreateObject("Outlook.Application")
    myRecipient = rs![email_address]
    If IsNull(myRecipient) = False Then
    Set oLook = CreateObject("Outlook.Application")
    Set oMail = oLook.CreateItem(0)
    With oMail
    .To = myRecipient
    .Subject = "Your IProvider Order " & rs![order_number] & ""
    .BodyFormat = olFormatHTML
    .HTMLBody = strFntNormal & str1 & "<br><br>" & strMessage & "<br>" & str3
    .Save
    End With
    End If
    Set oLook = Nothing
    Set oLook = Nothing
    'OPENING OUTLOOK AND GENERATING MAIL CONTENT WITH ATTACHMENT-END
    mlcount = mlcount + 1
    rs1.Close

    Do Until rs2.EOF
    rs2.Edit
    rs2![Email_Sent] = True
    rs2![EmailSent_Date] = Now()
    rs2.Update
    rs2.MoveNext
    Loop

    rs.MoveNext
    Next Progress_Amount
    SysCmd acSysCmdRemoveMeter
    Loop
    rs.Close
    'CREATING PDF FILES FOR ATTACH AND MAIL DRAFT-END
    End Sub


    only for writing email, its not for auto populate when customer replies back.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    If you want to add 'followup content' why not just have an If Then statement after the message text you already have to concatenate more text? Or have the conditional construct a completely different text. The only real trick is passing a criteria to the procedure to use in the conditional code.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    Hmm...lost ..
    could you please explain more clearly

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Maybe have a checkbox on form or some other criteria (maybe calculated from a date).

    str4 = " followup content text here"

    Then:

    .HTMLBody = strFntNormal & str1 & "<br><br>" & strMessage & "<br>" & str3 & IIf(Me.followupcheckbox, str4, "")

    There's a variety of ways to deal with this. Another version:

    If Me.followupcheckbox Then
    .HTMLBody = str4
    Else
    .HTMLBody = strFntNormal & str1 & "<br><br>" & strMessage & "<br>" & str3
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    vincent-leeway is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2013
    Posts
    36
    Is trigger not allowed here?

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    What do you mean by 'trigger'?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Cursor to follow SetFocus
    By roaftech in forum Forms
    Replies: 2
    Last Post: 01-31-2013, 01:54 PM
  2. Follow-up Reminder
    By 1gambit in forum Access
    Replies: 6
    Last Post: 06-30-2012, 11:42 AM
  3. Follow Up
    By robertjleach in forum Queries
    Replies: 2
    Last Post: 10-30-2011, 06:07 AM
  4. Follow up calls, put in automatic date
    By Loish in forum Access
    Replies: 1
    Last Post: 04-08-2010, 03:59 PM
  5. FOLLOW UP DATABSE
    By gab_esp in forum Database Design
    Replies: 2
    Last Post: 07-19-2006, 11:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums