Skip to content

Commit

Permalink
set Contact mailing address in HubSpotCrmService
Browse files Browse the repository at this point in the history
  • Loading branch information
brmeyer committed Jun 19, 2023
1 parent 3ca401f commit 36eeff0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,12 @@ protected void setContactFields(ContactProperties contact, CrmContact crmContact
}
setProperty(env.getConfig().hubspot.fieldDefinitions.contactLanguage, crmContact.language, contact.getOtherProperties());

contact.setAddress(crmContact.mailingAddress.street);
contact.setCity(crmContact.mailingAddress.city);
contact.setState(crmContact.mailingAddress.state);
contact.setZip(crmContact.mailingAddress.postalCode);
contact.setCountry(crmContact.mailingAddress.country);

// TODO: add/remove in default lists?
if (crmContact.emailOptIn != null && crmContact.emailOptIn) {
setProperty(env.getConfig().hubspot.fieldDefinitions.emailOptIn, true, contact.getOtherProperties());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ protected void setContactFields(SObject contact, CrmContact crmContact) {
if (crmContact.notes != null && crmContact.notes != "") {
contact.setField("Description", crmContact.notes);
}

// TODO: Avoiding setting the mailing address of a Contact, instead allowing the Account to handle it. But should we?
}

@Override
Expand Down

0 comments on commit 36eeff0

Please sign in to comment.