There is is nice action scripting "send an email"
One can easy setup sending emails with it and and in one flow store the message in the outbox specified in the project settings.
I need to store additional fields in the outbox, for example i created a field called contact_id in the outbox, to use it as a foreign key.
A part of the standard code the action scripting generates is below.
(the only line I added for testing a fixed contact_id line: pStore.contact_id = 10 )
The component runs without errors, but the value is not saved in the outbox table. Any idea's how to solve this?
the function a5_SaveToWebAppEmailOutBox() that is called seems to be undocumented, can't find any reference for it in the wiki.
'store message in outbox
if pe.storeMessageInOutbox = .t. then
pStore.dateStamp = now()
pStore.subject = pMessageSettings.subject
pStore.sent_by = pMessageSettings.from
pStore.sent_by_alias = pMessageSettings.from_alias
pStore.sendto = pMessageSettings.send_to
pStore.cc = pMessageSettings.cc
pStore.bcc = pMessageSettings.bcc
pStore.attachments = pMessageSettings.attachments
pStore.comments = ""
pStore.contact_id = 10
if pMessageSettings.html_message <> "" then
pStore.message = pMessageSettings.html_message
else
pstore.message = pMessageSettings.message
end if
dim flagMessageWasSavedInOutbox as l
dim pResult as p
'If an error occurs, pResult.errorText will contain the reason for the error.
flagMessageWasSavedInOutbox = a5_SaveToWebAppEmailOutBox(pStore,pResult)
end if
One can easy setup sending emails with it and and in one flow store the message in the outbox specified in the project settings.
I need to store additional fields in the outbox, for example i created a field called contact_id in the outbox, to use it as a foreign key.
A part of the standard code the action scripting generates is below.
(the only line I added for testing a fixed contact_id line: pStore.contact_id = 10 )
The component runs without errors, but the value is not saved in the outbox table. Any idea's how to solve this?
the function a5_SaveToWebAppEmailOutBox() that is called seems to be undocumented, can't find any reference for it in the wiki.
'store message in outbox
if pe.storeMessageInOutbox = .t. then
pStore.dateStamp = now()
pStore.subject = pMessageSettings.subject
pStore.sent_by = pMessageSettings.from
pStore.sent_by_alias = pMessageSettings.from_alias
pStore.sendto = pMessageSettings.send_to
pStore.cc = pMessageSettings.cc
pStore.bcc = pMessageSettings.bcc
pStore.attachments = pMessageSettings.attachments
pStore.comments = ""
pStore.contact_id = 10
if pMessageSettings.html_message <> "" then
pStore.message = pMessageSettings.html_message
else
pstore.message = pMessageSettings.message
end if
dim flagMessageWasSavedInOutbox as l
dim pResult as p
'If an error occurs, pResult.errorText will contain the reason for the error.
flagMessageWasSavedInOutbox = a5_SaveToWebAppEmailOutBox(pStore,pResult)
end if
Comment