Methylates caffeoyl-CoA to feruloyl-CoA and 5-hydroxyferuloyl-CoA to sinapoyl-CoA. Plays a role in the synthesis of feruloylated polysaccharides. Involved in the reinforcement of the plant cell wall. Also involved in the responding to wounding or pathogen challenge by the increased formation of cell wall-bound ferulic acid polymers (By similarity). (E)-caffeoyl-CoA + S-adenosyl-L-methionine = (E)-feruloyl-CoA + H(+) + S-adenosyl-L-homocysteine Binds 1 divalent metal cation per subunit. Aromatic compound metabolism; phenylpropanoid biosynthesis. A number of isoforms are produced. According to EST sequences. Belongs to the class I-like SAM-binding methyltransferase superfamily. Cation-dependent O-methyltransferase family. CCoAMT subfamily.