Skip to content

Commit d14ee6f

Browse files
committed
V14: Integrations (ActiveCampaign/Forms)
- Minor updates on ActiveCampaignWorkflow - Re generate api
1 parent e4e659e commit d14ee6f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/Umbraco.Forms.Integrations.Crm.ActiveCampaign/ActiveCampaignContactsWorkflow.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ public override async Task<WorkflowExecutionStatus> ExecuteAsync(WorkflowExecuti
6363
.ValuesAsString();
6464

6565
// Check if contact exists.
66-
var contacts = await _contactService.Get(email).ConfigureAwait(false);
66+
var contacts = await _contactService.Get(email);
6767

6868
if(contacts.Contacts.Count > 0 && !_settings.AllowContactUpdate)
6969
{
7070
_logger.LogInformation("Contact already exists in ActiveCampaign and workflow is configured to not apply updates, so update of information was skipped.");
7171

72-
return await Task.FromResult<WorkflowExecutionStatus>(WorkflowExecutionStatus.Completed);
72+
return WorkflowExecutionStatus.Completed;
7373
}
7474

7575
var requestDto = new ContactDetailDto { Contact = Build(context.Record) };
@@ -88,7 +88,7 @@ public override async Task<WorkflowExecutionStatus> ExecuteAsync(WorkflowExecuti
8888
}).ToList();
8989
}
9090

91-
var contactId = await _contactService.CreateOrUpdate(requestDto, contacts.Contacts.Count > 0).ConfigureAwait(false);
91+
var contactId = await _contactService.CreateOrUpdate(requestDto, contacts.Contacts.Count > 0);
9292

9393
if (string.IsNullOrEmpty(contactId))
9494
{
@@ -100,11 +100,10 @@ public override async Task<WorkflowExecutionStatus> ExecuteAsync(WorkflowExecuti
100100
// Associate contact with account if last one is specified.
101101
if (!string.IsNullOrEmpty(Account))
102102
{
103-
var associationResponse = _accountService.CreateAssociation(int.Parse(Account), int.Parse(contactId))
104-
.ConfigureAwait(false).GetAwaiter().GetResult();
103+
var associationResponse = _accountService.CreateAssociation(int.Parse(Account), int.Parse(contactId));
105104
}
106105

107-
return WorkflowExecutionStatus.Failed;
106+
return WorkflowExecutionStatus.Completed;
108107
}
109108
catch(Exception ex)
110109
{

src/Umbraco.Forms.Integrations.Crm.ActiveCampaign/Api/Management/Controllers/Contacts/GetCustomFieldsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ public GetCustomFieldsController(IOptions<ActiveCampaignSettings> options, ICont
1919
[HttpGet("custom")]
2020
[ProducesResponseType(typeof(CustomFieldCollectionResponseDto), StatusCodes.Status200OK)]
2121
public async Task<IActionResult> GetCustomFields() =>
22-
Ok(await _contactService.GetCustomFields().ConfigureAwait(false));
22+
Ok(await _contactService.GetCustomFields());
2323
}
2424
}

0 commit comments

Comments
 (0)