The above is a standard receiver definition apart from the priority field.
Using Go string templating, we're able to add simple if/else logic that matches Alertmanager priorities (either critical, warning, info or none) and assign them to corresponding P1 through P5 Opsgenie priorities.