I have created a method to update all email signatures in my company. It works, the signature is automatically set on new emails but for replies/forwards there is no signature.
Is it possible to update the signature for reply/forward?
My code:
public function updateSignature(User $user, string $email, string $newSignature): SendAs
{
// Executes the request with the address of its own user
$this->client->setSubject($user->getPrimaryEmail());
$serviceSendAs = new SendAs();
$serviceSendAs->setDisplayName($user->getFullName());
$serviceSendAs->setSignature($newSignature);
$serviceGmail = new Gmail($this->client);
return $serviceGmail->users_settings_sendAs->update($user->getPrimaryEmail(), $email, $serviceSendAs);
}
Thank ;)
I was running into the same issue and just figured out what's going on. For some Gmail accounts, the signature was updating and assigning both the "Compose" and "Reply/Forward" settings correctly, but for others, it was creating a new signature and only updating the "Compose" setting.
What I found was if I deleted all saved signatures for the accounts that were not updating the "Reply/Forward" setting and then ran the script, the signatures got created and both the "Compose" and "Reply/Forward" settings were set. Subsequent runs of the script also reflected correctly.
This is likely a bug since the API documentation explicitly states it will only update the "Compose" setting, but a favorable bug for sure.
Hope this helps!