feat: Ability to specify a subject line for outbound emails (#3168)
This commit is contained in:
@@ -24,12 +24,15 @@ export const actions = {
|
||||
commit(types.default.SET_CONTACT_CONVERSATIONS_UI_FLAG, {
|
||||
isCreating: true,
|
||||
});
|
||||
const { inboxId, message, contactId, sourceId } = params;
|
||||
const { inboxId, message, contactId, sourceId, mailSubject } = params;
|
||||
try {
|
||||
const { data } = await ConversationApi.create({
|
||||
inbox_id: inboxId,
|
||||
contact_id: contactId,
|
||||
source_id: sourceId,
|
||||
additional_attributes: {
|
||||
mail_subject: mailSubject,
|
||||
},
|
||||
message,
|
||||
});
|
||||
commit(types.default.ADD_CONTACT_CONVERSATION, {
|
||||
|
||||
@@ -44,7 +44,13 @@ describe('#actions', () => {
|
||||
axios.post.mockResolvedValue({ data: conversationList[0] });
|
||||
await actions.create(
|
||||
{ commit },
|
||||
{ inboxId: 1, message: { content: 'hi' }, contactId: 4, sourceId: 5 }
|
||||
{
|
||||
inboxId: 1,
|
||||
message: { content: 'hi' },
|
||||
contactId: 4,
|
||||
sourceId: 5,
|
||||
mailSubject: 'Mail Subject',
|
||||
}
|
||||
);
|
||||
expect(commit.mock.calls).toEqual([
|
||||
[types.default.SET_CONTACT_CONVERSATIONS_UI_FLAG, { isCreating: true }],
|
||||
@@ -65,7 +71,13 @@ describe('#actions', () => {
|
||||
await expect(
|
||||
actions.create(
|
||||
{ commit },
|
||||
{ inboxId: 1, message: { content: 'hi' }, contactId: 4, sourceId: 5 }
|
||||
{
|
||||
inboxId: 1,
|
||||
message: { content: 'hi' },
|
||||
contactId: 4,
|
||||
sourceId: 5,
|
||||
mailSubject: 'Mail Subject',
|
||||
}
|
||||
)
|
||||
).rejects.toThrow(Error);
|
||||
expect(commit.mock.calls).toEqual([
|
||||
|
||||
Reference in New Issue
Block a user