Emailing by rules

Hello all
I am trying to figure out sending emails by rules that I’ve been working on rule yaml file.
I have several rules on rule yaml file, and I want to know that if I can send different emails by different rules.
For example, I want to send an email to only one email address by ruleA, or send an email to another address by ruleB.
I need to know how to set email configuration on alermanager yaml file.