How to align (rotate) mesh by 2 verticles?
TeeTrinker is right: have you tried using the 3D cursor as the "Transform Pivot Point"? Snapping to other geometry does not work in this mode, so if you need absolute precision, I would recommend an add-on like Mesh Align Plus. It has many alignment options, but the one you are looking for in it is "Quick Align Lines". Keep in mind there are far more advanced options that may save you time later on.

Using Mesh Align Plus add-on, here's what I did to achieve the rotation you described:


Create a new plane mesh object with a side aligned to the final upright green line orientation you showed in your image.
Select this new plane, entered Edit Mode, select the edge
representing the green line, Mesh Align Plus>Quick Align Lines>Grab
Destination. Exit Edit Mode.
Select your plane you want to rotate.
Enter Edit mode. Select vertex 1 and vertex 2 like you show in your picture. Exit Edit Mode. Mesh
Align Plus>Quick Align Lines>Apply to: "Object".