Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed-new-email-api #146

Merged
merged 2 commits into from
Jun 16, 2023
Merged

Fixed-new-email-api #146

merged 2 commits into from
Jun 16, 2023

Conversation

saranyadevi-bc
Copy link
Collaborator

No description provided.

{
var messageSettingsVault = JsonConvert.DeserializeObject<MessageSettingsVault>(_secrets.Data["Email"].ToString());
Data.Add("Email:ApiKey", messageSettingsVault.ApiKey);
Data.Add("Email:TemplateId", messageSettingsVault.TemplateId);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

},
"Email": {
"ApiKey": "",
"TemplateId": ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -45,5 +47,13 @@ public async Task<bool> Post(MessageRequestModel message)
{
return await _messageProviderService.SendMessage(message);
}
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add description for this API, take reference of sms API

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

public async Task SendEmailAsync(EmailInfo emailInfo)
{
var apiKey = _configuration["Email:ApiKey"];
var templateId = !string.IsNullOrEmpty(emailInfo.TemplateId) ? emailInfo.TemplateId : _configuration["emailInfo:TemplateId"];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will not have TemplateId in config..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

_configuration = configuration;
_httpClientFactory = httpClientFactory;
}
public async Task SendEmailAsync(EmailInfo emailInfo)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add try catch in this method, refer sms method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

_configuration = configuration;
_httpClientFactory = httpClientFactory;
}
public async Task SendEmailAsync(EmailInfo emailInfo)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add required validation for email fields like To, TemplateId

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@ponselvamsakthivel-bc ponselvamsakthivel-bc merged commit 77ef7e8 into main Jun 16, 2023
ponselvamsakthivel-bc added a commit to ponselvamsakthivel-bc/ccs-ppg-notification-api that referenced this pull request Jul 5, 2024
…-Service/new-email-api

Fixed-new-email-api
ponselvamsakthivel-bc added a commit that referenced this pull request Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants