Commit 72b7d1ad authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add bcc variable support

parent 9c13c0c2
......@@ -25,6 +25,16 @@ void ConvertSnippetVariablesUtilTest::shouldTranslateVariables()
QStringLiteral("%CCFNAME"));
QCOMPARE(MessageComposer::ConvertSnippetVariablesUtil::snippetVariableFromEnum(MessageComposer::ConvertSnippetVariablesUtil::CcName),
QStringLiteral("%CCNAME"));
QCOMPARE(MessageComposer::ConvertSnippetVariablesUtil::snippetVariableFromEnum(MessageComposer::ConvertSnippetVariablesUtil::BccAddr),
QStringLiteral("%BCCADDR"));
QCOMPARE(MessageComposer::ConvertSnippetVariablesUtil::snippetVariableFromEnum(MessageComposer::ConvertSnippetVariablesUtil::BccLname),
QStringLiteral("%BCCLNAME"));
QCOMPARE(MessageComposer::ConvertSnippetVariablesUtil::snippetVariableFromEnum(MessageComposer::ConvertSnippetVariablesUtil::BccFname),
QStringLiteral("%BCCFNAME"));
QCOMPARE(MessageComposer::ConvertSnippetVariablesUtil::snippetVariableFromEnum(MessageComposer::ConvertSnippetVariablesUtil::BccName),
QStringLiteral("%BCCNAME"));
QCOMPARE(MessageComposer::ConvertSnippetVariablesUtil::snippetVariableFromEnum(MessageComposer::ConvertSnippetVariablesUtil::FullSubject),
QStringLiteral("%FULLSUBJECT"));
QCOMPARE(MessageComposer::ConvertSnippetVariablesUtil::snippetVariableFromEnum(MessageComposer::ConvertSnippetVariablesUtil::ToAddr),
......
......@@ -72,6 +72,22 @@ void ConvertSnippetVariableMenu::initializeMenu(bool onlyMenuForCustomizeAttachm
mMenu->addMenu(ccMenuVariable);
auto bccMenuVariable = new QMenu(i18n("Bcc"), mMenu);
bccMenuVariable->addAction(i18n("BCC Field Address"), this, [this]() {
Q_EMIT insertVariable(MessageComposer::ConvertSnippetVariablesUtil::BccAddr);
});
bccMenuVariable->addAction(i18n("BCC Field Last Name"), this, [this]() {
Q_EMIT insertVariable(MessageComposer::ConvertSnippetVariablesUtil::BccLname);
});
bccMenuVariable->addAction(i18n("BCC Field First Name"), this, [this]() {
Q_EMIT insertVariable(MessageComposer::ConvertSnippetVariablesUtil::BccFname);
});
bccMenuVariable->addAction(i18n("BCC Field Name"), this, [this]() {
Q_EMIT insertVariable(MessageComposer::ConvertSnippetVariablesUtil::BccName);
});
mMenu->addMenu(ccMenuVariable);
auto attachmentMenuVariable = new QMenu(i18n("Attachment"), mMenu);
attachmentMenuVariable->addAction(i18n("Number Of Attachments"), this, [this]() {
Q_EMIT insertVariable(MessageComposer::ConvertSnippetVariablesUtil::AttachmentCount);
......
......@@ -20,6 +20,14 @@ QString MessageComposer::ConvertSnippetVariablesUtil::snippetVariableFromEnum(Me
return QStringLiteral("%CCFNAME");
case CcName:
return QStringLiteral("%CCNAME");
case BccAddr:
return QStringLiteral("%BCCADDR");
case BccLname:
return QStringLiteral("%BCCLNAME");
case BccFname:
return QStringLiteral("%BCCFNAME");
case BccName:
return QStringLiteral("%BCCNAME");
case FullSubject:
return QStringLiteral("%FULLSUBJECT");
case ToAddr:
......
......@@ -17,6 +17,11 @@ enum VariableType {
CcLname,
CcFname,
CcName,
BccAddr,
BccLname,
BccFname,
BccName,
FullSubject,
ToAddr,
ToFname,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment