Extend context builder to set contact-preference

This commit is contained in:
Philipp Stracker 2025-06-13 15:04:07 +02:00
parent f300e10afb
commit 04c4d66889
No known key found for this signature in database

View file

@ -161,6 +161,20 @@ class ExperienceContextBuilder {
return $builder;
}
/**
* Applies a custom contact preference to the experience context.
*
* @param string|null $preference The new preference to apply.
*/
public function with_contact_preference( ?string $preference = null ) : ExperienceContextBuilder {
$builder = clone $this;
$builder->experience_context = $builder->experience_context
->with_contact_preference( $preference );
return $builder;
}
/**
* Returns the ExperienceContext.
*/