Querying Thunderbird's SQLite message database from C# - sqlite

I want to query email messages stored by Thunderbird from a C# application I am developing.
Currently I can get some message parts such as From address and Subject by querying the SQLite database, global-messages-db.sqlite.
SELECT subject FROM messagesText LIMIT 10;
I have not been able to locate the body of messages. I have searched for documentation of Thunderbird's storage but I can't find anything that describes where this is stored.
Where are the bodies of messages stored?

From my own experimentation, it seems you can get the list of messages with the below.
select * from messages;
In that result set, you'll notice each message has an id. To get the content of a particular message you can do the following.
select c0body,c1subject,c2attachmentNames,c3author,c4recipients from messagesText_content where docid = 1234;
This is assuming the id of the message you want is 1234.

Related

Firebase Cloud Firestore request

I have a MESSAGERECAP collection which includes a unique id for each message, the id of the receiver of the message, the id of the sender and the message itself. In my application, when the user clicks on a friend to chat with him, I want the chat activity to start with the list of messages they have both sent.
I did this but obviously it does not give the desired result :
Query query = messageRef.orderBy("mssgId",Query.Direction.DESCENDING);
// with messageRef a reference to the MESSAGERECAP collection
Here is an overview of my database
You are getting the whole list because you are not filtering the data, just ordering it. If you check the Querying documentation for Firestore, also provided by #FrankVanPuffelen on the comments of your question, you can see that you have to use .where() to filter the data that you want to retrieve.
Also, as pointed out by #Jay in the comments, you can use Compound Queries to create a logical AND on your query to retrieve the data you want.
So if you do something like:
messageRef.where("senderId", "==", [currentUserId])
.where("receiver_id", "==", [receiverUserId])
.orderBy("mssgId",Query.Direction.DESCENDING)
When you execute this query you will get all the messages sent by the current user to the receiving user of the correponding id.

Sending emails from Oracle 12c to each user for records they have yet to complete

I have several users who have incomplete records in the database. Some users have multiple incomplete records. I need to send each user a standard email that adds only the titles of the records that they need to complete.
I have limited Oracle knowledge and don't know where to begin doing this. What I do know is that I need to get a query of all users with incomplete records and as I loop through each user, send an email to that user that includes a sub-query of the records that they have that is incomplete.
The result will look something like this:
From: noreply#ficticious.com
To: bob#ficticious.com
Subject: You have Incomplete Records that need to be completed.
Dear Bob, you have the following records that are incomplete that we need completed in order to process your request:
Record A, Record D, Record F (query results)
Thanks for completing these records soonest.
Management
Any help leading me to the right path would be greatly appreciated.

How to fetch email marketing insights data from Marketo using API?

I am trying to fetch "Email Performance Report" from the platform
using API to analyze the KPI's like CTR etc by type of the email
(newsletter,email marketing etc).
I went through the documentation, however I didn't find endpoint from
which I can fetch the same.
Does anyone know if there is a way to get this information?
There is no endpoint to query reports directly. However, the good news is, that the “things” that make up an “Email Performance Report”, namely: email delivery, bounce, open and click are available to query via the API.
This means that you have to build the report yourself, but you can fetch the dataset to work on.
These “things” are called activity types (activity measured on a Lead) and can be fetched by querying against the Get Lead Activities endpoint, which is also mentioned as the Query in the API docs.
It sits at the GET /rest/v1/activities.json url and you have to pass a nextPageToken and the activityTypeIds as query parameters.
The nextPageToken indicates a datetime. Activities after that date will be returned by the call. To obtain one, you have to make a call to GET /rest/v1/activities/pagingtoken.json, where you have to specify the earliest datetime to retrieve activities from. See more about Paging Tokens.
To figure out the value of activityTypeIds, you first need to get the internal Ids of the activity types you are interested in. In order to do so, you have to query the GET /rest/v1/activities/types.json endpoint and look for the activity types with names like Send Email, Email Delivered, Email Bounced, Unsubscribe Email, Open Email and Click Email. (I don't know if these Ids are changing from instance to instance, but in ours these are from #6 to #11).
Once you have all of these bits at hand, you can make your request like that:
GET https://<INSTANCE_ID>.mktorest.com/rest/v1/activities.json?activityTypeIds=<TYPE_ID>&nextPageToken=<NEXTPAGE_TOKEN>&access_token=<ACCESS_TOKEN>
The result it gives is an array with items like below. Items can be filtered to specific email based on the primaryAttributeValue property and processed further accordingly.
{
"id":7370416,
"marketoGUID":"7170506",
"leadId":291305,
"activityDate":"2017-12-17T00:00:00Z",
"activityTypeId":11,// #11 = `Click Email`
"campaignId":1790,
"primaryAttributeValueId":1638,
"primaryAttributeValue":"EMAIL_NAME",// Name of the Email as seen in Marketo
"attributes":[
// …
]
}

handle multiple arrays in event result

I am writing an mobile app that retrives some data from an amf webservice and stores it in a database table(s). I don't always know what I will get returned as I send it a customer id and it returns all the information that the system has for that customer. Each set of information is returned as an array.
So I end up with a event.result that contains
user
orders
sales
profile
each one of those items can have multiple items under them, if the customer does not have any orders that that is not returned and I would have
user
sales
profile
so what I need to do is determine which arrays are returned and then insert/update them in the database. I have tried the following
var sales:Array
if (event.result.sales)
{
sales = event.result.sales
}
watching through the debugger it enters the if statement but once is completes sales is still null.
so I guess my question is what am I doing wrong? or is there a much better way of handling this
Thanks

retrieve value from query string

I am integrating openid in my website.
I am able to retrieve data(ex email) from op provider(by query string).
But different op provider gives data in different key like gmail gives it under openid.ext1.value.alia2 key and yahoo gives it in under some different key.
how should i retrieve value from query string.
You must check namespaces. For example, the server may return openid.ns.ax = http://openid.net/srv/ax/1.0, and that would mean "everything that starts with openid.ax relates to the AX extension".
But it could be openid.ns.qwerty = http://openid.net/srv/ax/1.0 as well, and then everything that starts with openid.qwerty would be related to the extension.
Your code must read those namespaces and use aliases as defined by those. Read specifications for more information.

Resources