save reply-to in recent emails
This commit is contained in:
@ -33,6 +33,12 @@ export class ReceivedEmail {
|
||||
@Column('text')
|
||||
html!: string
|
||||
|
||||
@Column('text')
|
||||
replyTo?: string
|
||||
|
||||
@Column('text')
|
||||
reply?: string
|
||||
|
||||
@Column('text')
|
||||
type!: 'article' | 'non-article'
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ interface EmailMessage {
|
||||
text: string
|
||||
forwardedFrom?: string
|
||||
receivedEmailId: string
|
||||
replyTo?: string
|
||||
}
|
||||
|
||||
function isEmailMessage(data: any): data is EmailMessage {
|
||||
@ -165,7 +166,9 @@ export function emailsServiceRouter() {
|
||||
req.body.subject,
|
||||
req.body.text,
|
||||
req.body.html,
|
||||
user.id
|
||||
user.id,
|
||||
'non-article',
|
||||
req.body.replyTo
|
||||
)
|
||||
|
||||
analytics.capture({
|
||||
|
||||
@ -2547,6 +2547,8 @@ const schema = gql`
|
||||
type: String!
|
||||
text: String!
|
||||
html: String
|
||||
replyTo: String
|
||||
reply: String
|
||||
createdAt: Date!
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,8 @@ export const saveReceivedEmail = async (
|
||||
text: string,
|
||||
html: string,
|
||||
userId: string,
|
||||
type: 'article' | 'non-article' = 'non-article'
|
||||
type: 'article' | 'non-article' = 'non-article',
|
||||
replyTo?: string
|
||||
): Promise<ReceivedEmail> => {
|
||||
return authTrx(
|
||||
(t) =>
|
||||
@ -20,6 +21,7 @@ export const saveReceivedEmail = async (
|
||||
html,
|
||||
type,
|
||||
user: { id: userId },
|
||||
replyTo,
|
||||
}),
|
||||
undefined,
|
||||
userId
|
||||
|
||||
@ -120,6 +120,7 @@ export const inboundEmailHandler = Sentry.GCPFunction.wrapHttpFunction(
|
||||
|
||||
// original sender email address
|
||||
const from = parsed['from']
|
||||
const replyTo = parsed['reply-to']
|
||||
const subject = parsed['subject']
|
||||
const html = parsed['html']
|
||||
const text = parsed['text']
|
||||
@ -140,6 +141,7 @@ export const inboundEmailHandler = Sentry.GCPFunction.wrapHttpFunction(
|
||||
subject,
|
||||
html,
|
||||
text,
|
||||
replyTo,
|
||||
})
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user