---
schema_version: "1"
id: 35a080a59abe640904909449cbce9f4ed4b0b73fb170dd5aed4e595151b4b6da
title: updateEmailTemplate(emailTemplateInput)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/life_sciences_dev_guide/apex_connect_api_LifeSciEmailTemplate_updateEmailTemplate.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.life_sciences_dev_guide.meta/life_sciences_dev_guide/apex_connect_api_LifeSciEmailTemplate_updateEmailTemplate.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 4594d50a9b3e5b039af0c7fded70d7f0b68f5f70add2ee2ed5408490b5363c11
description: Update an existing email template with the provided metadata.
---
# updateEmailTemplate(emailTemplateInput)

Update an existing email template with the provided metadata.

## API Version

65.0

## Requires Chatter

No

## Signature

public static ConnectApi.GenericResponseOutputRepresentation updateEmailTemplate(ConnectApi.EmailTemplateInputRepresentation emailTemplateInput)

## Parameters

emailTemplateInput

Type: [ConnectApi.EmailTemplateInputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.life_sciences_dev_guide.meta/life_sciences_dev_guide/apex_connect_api_input_email_template_input.htm "Input representation for creating or updating an email template.")

Input representation that contains the metadata for the email template. The fileId field is not accepted in this Apex representation.

## Return Value

Type: [ConnectApi.GenericResponseOutputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.life_sciences_dev_guide.meta/life_sciences_dev_guide/apex_connect_api_output_generic_response_output.htm "Output representation for a generic response from a Connect API call.")

## Example

ConnectApi.EmailTemplateInput input = new ConnectApi.EmailTemplateInput();
input.name = 'Sample Email Template Updated';
input.id = 'email-template-id';
input.emailSubject = 'Email Subject Updated';
input.description = 'Email template description Updated';
input.contentDocumentId = '069SB0000047U0mYAE';
input.activatedDate = Date.today();
input.deactivatedDate = Date.today().addDays(365);
input.senderType = 'PredefinedEmail';
input.senderEmailFieldAPIName = 'noreply@company.com';
input.replyToType = 'PredefinedEmail';
input.replyToEmailAddress = 'support@company.com';
input.bccEmailIdList = 'admin@company.com';
input.isActive = true;
input.isDefaultAutoEmailTemplate = false;
input.isSubjectLineEditable = true;
input.shouldIgnoreEmailConsent = false;
input.productId = '01t000000000001';
input.surveyId = 'survey-001';
input.communicationSubscriptionId = 'comm-sub-001';
input.automatedEmailContextType = 'ProviderVisit';
input.automatedEmailActionType = 'Create';
input.attachmentObjectTypes = new List<String>();
input.attachmentObjectTypes.add('Account');
input.languages = new List<String>();
input.languages.add('es\_AD');
input.languages.add('es');
input.topics = new List<String>();
input.topics.add('Onboarding');
input.topics.add('User Engagement');
System.debug(ConnectApi.LifeSciEmailTemplate.updateEmailTemplate(input));